[8939] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2557 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 11 13:09:36 1998

Date: Mon, 11 May 98 10:00:34 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 11 May 1998     Volume: 8 Number: 2557

Today's topics:
    Re: a header for `Mail me copies' or `Do not mail me co (John Stanley)
    Re: a header for `Mail me copies' or `Do not mail me co <zenin@bawdycaste.org>
    Re: a header for `Mail me copies' or `Do not mail me co (John Moreno)
    Re: cd with a perl-script (H. Eckert)
    Re: CGI file writes? (brian d foy)
    Re: CPAN & Module gripes (was Re: Ever Wonder...?) <merlyn@stonehenge.com>
        Detect if a script is already running? <alex@aloud.com>
    Re: Does Perl have a IDE?I don't like command line. (Ken Williams)
    Re: Email Authentication <rootbeer@teleport.com>
    Re: How can you break out of a 'while... ' loop in a fu <rootbeer@teleport.com>
    Re: How do you ignoe characters in <read> <aqumsieh@matrox.com>
    Re: How old is Perl? <beadles@nortel.com>
    Re: HTML::FormatText & parse_html - Doesn't work with t (brian d foy)
    Re: Learning Perl! <beske@worldnet.att.net>
    Re: Local GUI Perl Apps via DHTML mike_coyle@gmacm.com
    Re: memory efficiency question <aqumsieh@matrox.com>
        PERL and TUXEDO P.Planchon@usa.net
    Re: QRe: == vs. eq (John Moreno)
    Re: reading a text file w/Perl <rootbeer@teleport.com>
    Re: Ref to an LVALUE???  I expected a simple SCALAR ref <aas@sn.no>
    Re: regular expression assistance <aqumsieh@matrox.com>
    Re: regular expression assistance (brian d foy)
    Re: Submit (brian d foy)
    Re: uuencode algorithm <zenin@bawdycaste.org>
    Re: uuencode algorithm (brian d foy)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 11 May 1998 16:00:33 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: a header for `Mail me copies' or `Do not mail me copies'
Message-Id: <6j77b1$d77$1@news.NERO.NET>

In article <1d8uz42.179bwk8bqtimsN@roxboro0-002.dyn.interpath.net>,
John Moreno <phenix@interpath.com> wrote:
>In news.software.readers John Stanley <stanley@skyking.OCE.ORST.EDU>
>wrote:
>
>> Russell Schulz  <Russell_Schulz@locutus.ofB.ORG> wrote:
>> 
>> >> Please provide an RFC reference that defines this header for news.
>> >
>> >I can't.
>> 
>> Then we won't jump up and down expecting it to have any value.
>
>Then I suppose the programs[1] that use it and their users don't exist.

You may supposed whatever you wish, but since I didn't say that, or
anything even close to that, you are picking a fight with the wrong
person.



------------------------------

Date: 11 May 98 16:25:59 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: a header for `Mail me copies' or `Do not mail me copies'
Message-Id: <894904648.813021@thrush.omix.com>

John Moreno <phenix@interpath.com> wrote:
	>snip<
: Then I suppose the programs[1] that use it and their users don't exist.
: [1] -  slrn, Gnus, MacSOUP, rnr, NewsReader.Com, NewsWatcher,
: MT-NewsWatcher -- and that's only of the ones that *I* know about.

	Your point?  It's a non-standard, non-required header.  It's also
	in what could only be called "header alpha" since it's arguments
	haven't even been settled yet.  Hell, it's not even in the current
	drafts.  That being the case, the header is meaningless.

-- 
-Zenin
 zenin@archive.rhps.org


------------------------------

Date: Mon, 11 May 1998 16:39:32 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: a header for `Mail me copies' or `Do not mail me copies'
Message-Id: <1d8v6ci.hjxajr17bxrapN@roxboro0-002.dyn.interpath.net>

In news.software.readers John Stanley <stanley@skyking.OCE.ORST.EDU>:

> John Moreno <phenix@interpath.com> wrote:
> >In news.software.readers John Stanley <stanley@skyking.OCE.ORST.EDU>
> >wrote:
> >
> >> Russell Schulz  <Russell_Schulz@locutus.ofB.ORG> wrote:
> >> 
> >> >> Please provide an RFC reference that defines this header for news.
> >> >
> >> >I can't.
> >> 
> >> Then we won't jump up and down expecting it to have any value.
> >
> >Then I suppose the programs[1] that use it and their users don't exist.
> 
> You may supposed whatever you wish, but since I didn't say that, or
> anything even close to that, you are picking a fight with the wrong
> person.

The programs and their users exist - people benefit (or at least
appreciate having and using) these programs and this specific feature.
It has value.  To deny this is equivalent to denying that the users and
the programs exist.

-- 
John Moreno


------------------------------

Date: 11 May 1998 13:35:04 GMT
From: ripley@nostromo.in-berlin.de (H. Eckert)
Subject: Re: cd with a perl-script
Message-Id: <slrn6ldvk8.om1.ripley@nortobor.nostromo.in-berlin.de>

art@flying.broomstick.com (Arthur Hagen):
> In <6isqm8$u2k$2@news.vossnet.de>, "Axel Rvmer" <aroemer@vossnet.de> writes:
> > The . (dot) command executes the following script in the *current* shell.
> 
> Sure, but that too makes assumptions about the shell being of the
> bourne shell family, and will change everything else that the script
> does to the environment too, and not just the cwd.

Are we talking about perl here or are we talking about shell scripts ?
Sourcing a perl script into a (c)sh won't work.  The backtick operator
is at least compatible between Bourne and C shell.
The difference between "." and "source" is just some typing.

Greetings,
				Ripley
-- 
http://www.in-berlin.de/User/nostromo/


------------------------------

Date: Mon, 11 May 1998 12:25:08 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI file writes?
Message-Id: <comdog-ya02408000R1105981225080001@news.panix.com>
Keywords: from just another new york perl hacker

In article <894817050.33805@ajatar.dragon.net.au>, "Noel Sampol" <noels@chilli.net.au> posted:

>If I wrote a CGI script that does a file write to a specified server file in
>my web site,
>what happens when the CGI script is executed by multiple users
>simultaneously?

well, what happened when you tried it?

>Will the data I write to the file be corrupted or does the web server know
>how to handle this
>situation? 

the web server doesn't know about most things the script will do.  it
feeds the script data then waits for output.  anything else is up to
you.

if you only want one process at a time to write to the file, you 
need to deal with file locking.  hit counters and such have to deal with
this, so you might want to take a look at some source for those to
see what they do.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


------------------------------

Date: Mon, 11 May 1998 16:18:09 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
To: eryq@zeegee.com
Subject: Re: CPAN & Module gripes (was Re: Ever Wonder...?)
Message-Id: <8c4sywbx4a.fsf@gadget.cscaper.com>

>>>>> "eryq" == eryq  <eryq@zeegee.com> writes:

>> Actually, I did something like that locally <grin>
>> $ cat /usr/local/bin/cpan
>> #! /bin/ksh
>> 
>> perl -w -MCPAN -e shell

eryq> Me too... heck, doesn't *everyone* do this?  :-)

I just did this:

    $ cat cpr
    #!/home/merlyn/bin/perl

    use CPAN;
    CPAN::Shell->r;
    shell;
    $

This rocks.  Run it every morning.  See what is new in the CPAN, to
know if you're running downrev standard modules.

Unfortunately, we are now up to 7 things in the CPAN where new
versions won't install even though the old versions did, on a fairly
vanilla platform (sunos 5.5.1).  <sigh>

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 112 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


------------------------------

Date: Mon, 11 May 1998 16:39:59 GMT
From: "Aloud.com" <alex@aloud.com>
Subject: Detect if a script is already running?
Message-Id: <35572A79.576CD809@aloud.com>

Hi,

Is there anyway to detect whether a perl script is already running?

You could do it really crudely by ps -ef  | grep pl ...etc

There must be a perl command or something nicer?

Thanks,

Alex



------------------------------

Date: Mon, 11 May 1998 12:41:04 -0400
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <ken-1105981241040001@news.swarthmore.edu>

In article <6j4sff$jn0$9@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>: Anyway, I do know of one Perl system that has some IDE features: MacPerl.
>: The base application includes a simple editor/debugger/... which, though
>: limited to smallish (32 KB) files, is quite convenient.  Larger scripts
>: can be handled using a text editor such as BBEdit, which offers syntax-
>: directed text coloring and other Perl-sensitive features.
>
>Using an editor that claims to do syntax highlighting is like riding a
>bicycle with training wheels so rickety they're bound to break at any
>moment.  Parsing Perl is no small problem, and any editor that claims to
>do more than a half-ass job is lying.

No, maybe they're doing a 3/4-assed job.  Quite possible.  Sure, they're
not going to emulate the whole run-time Perl machine just to color your
darn syntax, but that doesn't mean it's not useful.  It gives you one more
structural view of your code - combine nice colors with good indentation,
good spacing, and all that, and you've got some nice readable code.  The
colors help me see what's going on at a glance.

That said, I do have a few gripes with BBEdit's coloring.  It messes up on
things like this:
      local $" = ':';
No biggie, just do this to terminate the runaway string:
      local $" = ':'; #" Quote added for BBEdit

Here's the biggest pain, though.  As of the latest version of BBEdit, the
stuff inside a regexp is colored as a string.  I wish I could turn that
off, or color it with a different color or something.  Worse, they
sometimes get the boundaries of a regexp wrong.



But just because the coloring isn't perfect doesn't mean it's not useful. 
Should we declare Perl non-useful because its tied hashes can't do
multi-dimensional hashes right?  I don't think so.  There's the baby, and
there's the bathwater, and you have to be able to tell the difference.

By the way, does anyone know who writes the Perl syntax parser for
BBEdit?  One of their people, or someone here, or both, or what?  It seems
to be compiled right into the program.


------------------------------

Date: Mon, 11 May 1998 16:01:25 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Alex K <techsoft@abcpages.com>
Subject: Re: Email Authentication
Message-Id: <Pine.GSO.3.96.980511085927.21974H-100000@user2.teleport.com>

On Sun, 10 May 1998, Alex K wrote:

> how about trying to ping the current IP?

No, that doesn't validate an email address. Read the FAQ, section nine.
Thanks!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Mon, 11 May 1998 15:59:09 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Stuart Wright <stu-w@usa.net.remove.everything.after.net>
Subject: Re: How can you break out of a 'while... ' loop in a function?
Message-Id: <Pine.GSO.3.96.980511085220.21974G-100000@user2.teleport.com>

On Mon, 11 May 1998, Stuart Wright wrote:

> A simple question, but all the pearl FAQs are useless.

Please justify that sweeping generalization.

> All I want is a basic perl/cgi reference - all the commands, functions
> etc.

You couldn't have looked very hard at the FAQ if you didn't find pointers
to documentation on all parts of Perl. And those docs also lead you to
references on CGI scripting, too, at no extra charge.

> Very hard to find one.

If you find the docs insufficient, please submit a patch. Thanks!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Mon, 11 May 1998 12:01:59 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: How do you ignoe characters in <read>
Message-Id: <355720F7.9B869A89@matrox.com>

John Mosey wrote:

> :> Example, the line really is
> :> Jim Jack Joe .25 truck pig man

Hmmm....
To be honest I have no idea how your code maps to what you want to do!
But, since your lines are space-delimited, why not simply use this:

$fname = "your_file_name.htm";   #whatever
open READ, $fname or die "can't open $fname: $!";
while (<READ>) {
    @array = split /\s+/;
    # @array now contains the fields (including the decimal point)
    # do whatever you want with it because it will be overwritten by the next
    # iteration of the while loop (if there is one)
}

That should do it unless I totally misunderstood your question.

--
Ala Qumsieh             |  No .. not just another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)





------------------------------

Date: Mon, 11 May 1998 10:56:53 -0500
From: John Beadles <beadles@nortel.com>
Subject: Re: How old is Perl?
Message-Id: <35571FC5.780031FF@nortel.com>

Rosemary I H Powell wrote:
> 
> In article <355381E6.1BAD95E4@nortel.com>, John Beadles
> <beadles@nortel.com> writes
> >Tom Christiansen wrote:
> >
> >>
> >> PUMPKIN?
> >>
> >>   [from Porting/pumpkin.pod in the Perl source code distribution]
> >>
> >>   Chip Salzenberg gets credit for that, with a nod to his cow orker,
> >>   David Croy.  We had passed around various names (baton, token,
> >>   hot potato) but none caught on. Then, Chip asked:
> >>
> >
> >OK, so know we know what a pumpkin is.  What I want to know is what is
> >a  cow orker?
> >
> >Come to think of it, maybe I don't want to know after all... ;-)
> Yes you do - it's someone who orkes cows. Obviously.
> :-)
> Rosemary,
> Just missing drowning her keyboard in coffee.

Oh, thanks for the visualization - now I've got to go wash my mind out. 
Got any mental floss on you? :-D

-- 
------------------------------------------------
John T. Beadles            Nortel CDMA RF Design                       
Office: 972-685-7813           Fax: 972-684-3767 
Email (office):    beadles@nortel.removethis.com  
Any opinions are mine and to do not represent
             those of my employer
------------------------------------------------


------------------------------

Date: Mon, 11 May 1998 12:49:47 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: HTML::FormatText & parse_html - Doesn't work with tables.
Message-Id: <comdog-ya02408000R1105981249470001@news.panix.com>
Keywords: from just another new york perl hacker

In article <m3d8dmy6qj.fsf@furu.g.aas.no>, Gisle Aas <aas@sn.no> posted:

>"Ben" <ben@wallroyds.demon.co.uk> writes:
>

>> $plain_text = HTML::FormatText->new->format(parse_html($html_text));
>> 
>> Will remove HTML from a string. But, there's a problem - It doesn't work
>> with tables.

>I would not call that proper formatting of tables.  The problem is
>simply that nobody has cared enough to write the code that does this.

well, i've been thinking about this problem while on the subway recently.
it's not an easy problem to be sure.  i always seem to convince myself
to not do it, then think about it again the next day.  if i could figure
out what to do with COLSPAN and ROWSPAN, life might be simpler.

>Perhaps you want to do it?

if someone does decide to do this, please let me know so i stop thinking
about it. :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


------------------------------

Date: Mon, 11 May 1998 12:16:43 -0400
From: Bryan Beske <beske@worldnet.att.net>
Subject: Re: Learning Perl!
Message-Id: <6j78ar$sj4@bgtnsc02.worldnet.att.net>

Try:

http://www.onsightinc.com/training/perl



------------------------------

Date: Mon, 11 May 1998 15:55:46 GMT
From: mike_coyle@gmacm.com
Subject: Re: Local GUI Perl Apps via DHTML
Message-Id: <6j7723$mok$1@nnrp1.dejanews.com>

I wholeheartedly agree.  Let me clarify: My question referred to using Perl
and Dynamic HTML locally to provide a non-tk GUI for Perl Applications.  I am
curious about anyone's use of HTML or DHTML and Perl in a non-cgi
environment, where Perl application would read from and output to a local web
browser.

Thanks,
       Mike

In article <qcv5j6.dof.ln@localhost>,
  tadmc@flash.net (Tad McClellan) wrote:

> Most Perl programs are not related to the WWW at all, so using
> "typically" with regards to Perl is not accurate.
>
> It would be accurate with regards to CGI programs. But such things
> are discussed in a different newsgroup.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Mon, 11 May 1998 11:52:38 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: memory efficiency question
Message-Id: <35571EC6.429EB51F@matrox.com>

David Waring wrote:

> When reading from a filehandle, does
>
> while <FILEHANDLE>
>
>  read the whole file into MEMORY at once or one line at a time?  Just

This reads your file one line at a time. The end of a line is defined by
the $\ variable.

> wondering if this is more memory efficient than;
>
> @myarray=<FILEHANDLE>
>
> David

 This loads the entire file into an array. This should be faster, but if
your file is large, you might have memory problems ...
Using either approaches really depends on your application.

Hope that was helpful,

--
Ala Qumsieh             |  No .. not just another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)





------------------------------

Date: Mon, 11 May 1998 16:49:45 GMT
From: P.Planchon@usa.net
Subject: PERL and TUXEDO
Message-Id: <6j7a79$qis$1@nnrp1.dejanews.com>

Anyone here knows about a TUXEDO module for perl ?

Basically, I'd like to :
- write a tuxedo client in perl
- write a tuxedo server in perl

My search in CPAN and perl or tuxedo newsgroups gave no result, so if you
have something that could help, please tell me.

Thanks in advance.

Philippe Planchon

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Mon, 11 May 1998 16:15:15 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: QRe: == vs. eq
Message-Id: <1d8v5gb.14qcbep1sdy36oN@roxboro0-002.dyn.interpath.net>

Greg Bacon <gbacon@cs.uah.edu> wrote:

>   "Allan M. Due" <due@murray.fordham.edu> writes:
> : Greg Bacon wrote in message <6j4r5s$jn0$7@info.uah.edu>...
> : >I can only assume that Lookout! doesn't warn posters when their lines
> : >are beyond the 78 columns that netiquette requests.
> : 
> : Well no, no warning but the default is 76 so Outlook users are unlikely to
> : change it since they are unsophisticated users by definition.  Which
> : programs offer such warnings?
> 
> GNKSA 2.0 compliant software warns about lines longer than eighty
> characters.  A newsreader allowing its users to change this value is
> evil.

Well, not exactly - if they are able to change it on system-wide basis,
I'd agree.  But if they can change it only on a per post basis (i.e.
it's ARTICLE preference) or for a specific newsgroup (there are poetry
groups for example where the <80 is routinely ignored because it doesn't
fit in with what they are doing).
 
> : > (Keep in mind that you should try to keep the lines you write around 72
> : > columns
> [watch your quoting]
> : Have changed the default values, thanks.  But as long as I use Outlook
> : wisely (no MIME for example) I am not discomfiting folks unduly, is that
> : correct?  Just trying to be clear.
> 
> You'll be much better off if you can coax it into omitting whatever
> identifying headers (e.g., X-Newsreader:, X-MIME-Ole:, etc.) it might
> otherwise insert.  Son-of-1036 frowns on such vanity headers anyway.
> With real newsreader software (as opposed to hardware on CD), you can go
> in and modify the source to do the right thing.

On this I have to disagree - I think son-of-1036 missed the benefits of
X-Newsreader.  I've recently had a problem with a poster with quoted
lines like:

> blah blah this is what happens whe
n it wraps
> and it did indeed wrap early (somewhere around 62 ch
aracters.

It is my opinion they didn't include the X-Newsreader header because
they didn't want people to know what program (Ameol2) was producing such
junk.  I of course don't have any evidence to base this on except for
the lousy articles that it produced.

-- 
John Moreno


------------------------------

Date: Mon, 11 May 1998 16:04:03 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Leigh Vincent <sjogbal@netconnect.com.au>
Subject: Re: reading a text file w/Perl
Message-Id: <Pine.GSO.3.96.980511090315.21974I-100000@user2.teleport.com>

On 11 May 1998, Leigh Vincent wrote:

> open(INFILE,"< text.file");

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.

> while (<INFILE>) {
> 	printf("%s",$_);
> }

Using printf in this case is overkill! You merely want to print the
string. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: 11 May 1998 18:13:04 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: Ref to an LVALUE???  I expected a simple SCALAR ref!
Message-Id: <m31zu0kcq7.fsf@furu.g.aas.no>

Eryq <eryq@zeegee.com> writes:

> Here's an *actual* snippet of the code, which *sometimes*
> dies via the indicated fatal expression.

I discovered the same problem myself today.  It can be reproduced with
the following code running under perl5.004_04.

   sub foo { $_[0] = 1; }
   foo($foo->[0]);

   use Storable qw(store);
   store($foo, "foo");

This problem have been eliminated in perl5.004_05-tobe.  Probably by
this patch:

Change 622 on 1998/03/02 by TimBunce@ig.co.uk

     Title:  "Don't upgrade target of assignment from LVALUE", #F005
      From:  Chip Salzenberg
     Files:  sv.c

-- 
Gisle Aas


------------------------------

Date: Mon, 11 May 1998 11:25:02 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: regular expression assistance
Message-Id: <3557184E.2F908C8E@matrox.com>

Tim Hodges wrote:

> I need to form a regular expression that matches either of these:
>
> > ba6c32h
> < djaycc7
>
> That is, either a greater than or less than symbol, followed by a
> space and then an alphanumeric string with lowercase letters.
>
> So.. you regex experts give me a hand??
>
> Tim Hodges
> 7twh@ttc-cmc.net

A lot of people are afraid of ReqExps .. (i know because I was one :-) )
 ..
it turns out that they are easy and straight-forward to understand. For
a simple problem like this I suggest that you read a few paragraphs
about regexps .. this would give you the knowledge (and possibly the
interest) to solve your problem .. and would save you a lot of time.
AnywayZ, I believe this should do the trick for you ..

 /(>|<) \w+/


Enjoy,

--
Ala Qumsieh             |  No .. not just another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)





------------------------------

Date: Mon, 11 May 1998 12:54:57 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: regular expression assistance
Message-Id: <comdog-ya02408000R1105981254570001@news.panix.com>
Keywords: from just another new york perl hacker

In article <3557184E.2F908C8E@matrox.com>, Ala Qumsieh <aqumsieh@matrox.com> posted:

>Tim Hodges wrote:
>
>> I need to form a regular expression that matches either of these:
>>
>> > ba6c32h
>> < djaycc7
>>
>> That is, either a greater than or less than symbol, followed by a
>> space and then an alphanumeric string with lowercase letters.

>AnywayZ, I believe this should do the trick for you ..

> /(>|<) \w+/

remember, it should not only match valid strings, but *not match*
invalid ones.  perhaps you can guess some strings that this would
match, but that are not valid, based on the original specification? :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


------------------------------

Date: Mon, 11 May 1998 12:43:03 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Submit
Message-Id: <comdog-ya02408000R1105981243030001@news.panix.com>
Keywords: from just another new york perl hacker

In article <3555d88b.2129352@news.ica.net>, techsoft@abcpages.com (Alex K) posted:

>On Tue, 28 Apr 1998 00:40:57 -0500, Mikey Vaughan <mikey@in.net>
>wrote:

>>Does somebody have a routine that allows the submit button to be
>>executed only once??  

>well.., assuming you use formmail , just add several options to it ,
>to check the IP of the user who submits info.., and keep it in cash
>for 5 minutes , and then it will check if the person submitted
>recenlty (during this 5 minutes) then it just cancel his request and
>won't do anyhting.. 

blocking by IP doesn't help.  it's those damn proxies again!  but then,
if you just blocked all AOL browsers, you would find the problem would
mostly disappear (it's not the user, it's the browser that allows one
to bounce up and down on the submit button).

other options:

   * use session ID's.  

   * don't allow duplicate entries in the database (MD5 is nice for
   that - (SELECT * FROM foo WHERE digest='$digest') should return
   no rows - bit of a concurrency problem here, so you have to deal
   with locking issues as well), or if you have a flat file thing, use 
   a script to remove duplicate entries (read "kludge").

   * or my favorite - pretend the problem doesn't exist and maybe
   it will go away ;)

there's probably something in the CGI FAQ about this as well.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


------------------------------

Date: 11 May 1998 15:55:33 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: uuencode algorithm
Message-Id: <894902580.192826@thrush.omix.com>

Chris Hester <chrishester@NOSPAMmyself.com> wrote:
: where user:password is scrambled using the uuencode algorithm.
: My first question is is this correct?

	Hmm, could be.  It would be lame, but it could be.  The CGI/Web
	newsgroups would more likely offer a better answer though.

: If so, does anyone know where I can get a uuencode algorithm in written
: in perl?

	sub uuencode { return pack 'u', shift }
	sub uudecode { return unpack 'u', shift }

	perldoc -f pack

	Hope this helps!

-- 
-Zenin
 zenin@archive.rhps.org


------------------------------

Date: Mon, 11 May 1998 12:30:57 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: uuencode algorithm
Message-Id: <comdog-ya02408000R1105981230570001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6j73mi$6mg@bolivia.earthlink.net>, "Chris Hester" <chrishester@NOSPAMmyself.com> posted:

>uses the REMOTE_USER variable.  According to a book I have, the client
>should send the following in the http header when authentication is
>required:
>
>Authorization: Basic user:password

> My first question is is this correct? ?

the HTTP specification knows for sure.  see the CGI Meta FAQ for
the reference.

>If so, does anyone know where I can
>get a uuencode algorithm in written in perl

in HTTPeek i used a MIME module.  Zenin's pack() suggestion is 
just as good though.

   use MIME::Base64;
   encode_base64( $user . ':' . $password );

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 2557
**************************************

home help back first fref pref prev next nref lref last post