[24395] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6583 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 19 18:06:13 2004

Date: Wed, 19 May 2004 15:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 19 May 2004     Volume: 10 Number: 6583

Today's topics:
        /m, /s: better mnemonic than "multiple", "single"? <jkrugman345@yahbitoo.com>
    Re: /m, /s: better mnemonic than "multiple", "single"? (Randal L. Schwartz)
    Re: /m, /s: better mnemonic than "multiple", "single"? <usenet@morrow.me.uk>
        Checking command line switches <roger1023@yahoo.com>
    Re: Checking command line switches <remorse@partners.org>
        How to find the target of a Unix symlink? <socyl@987jk.com>
    Re: IO::Socket problem <ThomasKratz@REMOVEwebCAPS.de>
    Re: IO::Socket problem <someone@somewhere.com>
    Re: iterating over arrays with map - problem <mothra@mothra.com>
    Re: iterating over arrays with map - problem <mothra@mothra.com>
    Re: Meaning of Orthogonality <ThomasKratz@REMOVEwebCAPS.de>
    Re: Meaning of Orthogonality <ewijaya@singnet.com.sg>
    Re: Meaning of Orthogonality <1usa@llenroc.ude>
    Re: Meaning of Orthogonality (Jim Keenan)
    Re: Meaning of Orthogonality <xaonon@hotpop.com>
    Re: noob question: Trying to extract part of a string i (cayenne)
    Re: noob question: Trying to extract part of a string i <remorse@partners.org>
    Re: noob question: Trying to extract part of a string i <ittyspam@yahoo.com>
    Re: Password scheme/Persistent session... (krakle)
    Re: Password scheme/Persistent session... (krakle)
    Re: Password scheme/Persistent session... <flavell@ph.gla.ac.uk>
    Re: Password scheme/Persistent session... <tadmc@augustmail.com>
    Re: Password scheme/Persistent session... (Malcolm Dew-Jones)
    Re: perl 5.8.3 problem <No_4@dsl.pipex.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 19 May 2004 15:47:48 +0000 (UTC)
From: J Krugman <jkrugman345@yahbitoo.com>
Subject: /m, /s: better mnemonic than "multiple", "single"?
Message-Id: <c8fvj4$kvq$1@reader2.panix.com>




For the life of me, I can never remember what the /m and /s regexp
modifiers mean.  I know that "s" stands for "single line" and "m"
stands for "multiple lines", but this is of no help: I still have
to look up what that "single" and "multiple" means as far as the
modified regexp's behavior.

TIA,

jill
-- 
To  s&e^n]d  me  m~a}i]l  r%e*m?o\v[e  bit from my a|d)d:r{e:s]s.



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

Date: Wed, 19 May 2004 17:10:24 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: /m, /s: better mnemonic than "multiple", "single"?
Message-Id: <67a87e90e3be5df38351f023269941af@news.teranews.com>

>>>>> "J" == J Krugman <jkrugman345@yahbitoo.com> writes:

J> For the life of me, I can never remember what the /m and /s regexp
J> modifiers mean.  I know that "s" stands for "single line" and "m"
J> stands for "multiple lines", but this is of no help: I still have
J> to look up what that "single" and "multiple" means as far as the
J> modified regexp's behavior.

I just call them the "s and m options".

:-)

print "Just another Perl hacker,"; # the original

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Wed, 19 May 2004 19:44:57 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: /m, /s: better mnemonic than "multiple", "single"?
Message-Id: <c8gdfp$9lr$1@wisteria.csv.warwick.ac.uk>


Quoth J Krugman <jkrugman345@yahbitoo.com>:
> 
> For the life of me, I can never remember what the /m and /s regexp
> modifiers mean.  I know that "s" stands for "single line" and "m"
> stands for "multiple lines", but this is of no help: I still have
> to look up what that "single" and "multiple" means as far as the
> modified regexp's behavior.

/s affects a single metacharacter, '.'.
/m affects multiple metacharaters, '^' and '$'.

Ben

-- 
               We do not stop playing because we grow old; 
                  we grow old because we stop playing.
                            ben@morrow.me.uk


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

Date: 19 May 2004 14:05:50 GMT
From: Roger <roger1023@yahoo.com>
Subject: Checking command line switches
Message-Id: <2004519-16550-770208@foorum.com>



#Greetings Perl folks, I have writen the code below, and it works just like I
# want. However, as a beginner I was concerned the code was not very 
# 'perl-ish' so if anyone can comment on the working code below, I'd
# be appreciative and have a nice day.

# ########################################################################## #
# Check the user input if any. If restart usage is: progname -r mm/dd/yyyy   #
# ########################################################################## #
 if (!@ARGV == 0) {
    if ($ARGV[0] eq '-r')
    {
            ($month, $day, $year) = split /\//, $ARGV[1]; 
            $month = $month +0;  # these strip off
            $day = $day + 0;     # any leading zeros
            if ($month > 12 || $month < 1  || $day > 31
            || $day < 1 || $year > 2035 || $year < 2000)
            {
            print "\n  Invalid date ".$ARGV[1]; exit;  }
            else {$now_date = $ARGV[1];
                  $file_date = substr($ARGV[1] ,0,5); $file_date  =~ s/\///g;}
    }
    elsif ( $ARGV[0] ne '-r') {print "\n Invalid switch ".$ARGV[0]; exit;}
 }


-- 
Use our news server 'news.foorum.com' from anywhere.
More details at: http://nnrpinfo.go.foorum.com/


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

Date: Wed, 19 May 2004 14:01:40 -0400
From: Richard Morse <remorse@partners.org>
Subject: Re: Checking command line switches
Message-Id: <remorse-69B2A3.14014019052004@plato.harvard.edu>

In article <2004519-16550-770208@foorum.com>,
 Roger <roger1023@yahoo.com> wrote:

> #Greetings Perl folks, I have writen the code below, and it works just like I
> # want. However, as a beginner I was concerned the code was not very 
> # 'perl-ish' so if anyone can comment on the working code below, I'd
> # be appreciative and have a nice day.
> 
> # ########################################################################## #
> # Check the user input if any. If restart usage is: progname -r mm/dd/yyyy   #
> # ########################################################################## #
>  if (!@ARGV == 0) {
>     if ($ARGV[0] eq '-r')
>     {
>             ($month, $day, $year) = split /\//, $ARGV[1]; 
>             $month = $month +0;  # these strip off
>             $day = $day + 0;     # any leading zeros
>             if ($month > 12 || $month < 1  || $day > 31
>             || $day < 1 || $year > 2035 || $year < 2000)
>             {
>             print "\n  Invalid date ".$ARGV[1]; exit;  }
>             else {$now_date = $ARGV[1];
>                   $file_date = substr($ARGV[1] ,0,5); $file_date  =~ s/\///g;}
>     }
>     elsif ( $ARGV[0] ne '-r') {print "\n Invalid switch ".$ARGV[0]; exit;}
>  }

You can save yourself some trouble by looking at Getopt::Std and 
Getopt::Long, which will handle some of the logic you need.

Also, I don't think you need to strip any leading zero explicitly -- 
using the values in the comparison will trigger the translation 
automatically.

There are a number of modules on CPAN dealing with dates.  These would 
presumably also handle things like making sure that February doesn't end 
up with 31 days...

Ricky

-- 
Pukku


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

Date: Wed, 19 May 2004 20:45:36 +0000 (UTC)
From: kj <socyl@987jk.com>
Subject: How to find the target of a Unix symlink?
Message-Id: <c8gh1g$re5$1@reader2.panix.com>




How does one find the target(s) of a Unix symlink?

I guess one klugey way would be to pick through the output of
"/bin/ls -al":

  sub get_target {
    my ($link, $seen) = @_;
    $seen ||= {};
    return $link if $seen->{$link}; # circularity
    return $link unless -e $link;
    my $ls = (`/bin/ls -al $link`)[0];   # ick!
    return $link unless $ls =~ /\s${link} ->\s+(.*?)\s*$/;
    $seen->{$link} = 1;
    get_target($1, $seen); 
  }

Is there a more civilized way to do this?

Thanks!

kj

-- 
NOTE: In my address everything before the period is backwards.


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

Date: Wed, 19 May 2004 17:22:52 +0200
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: IO::Socket problem
Message-Id: <40ab7d46.0@juno.wiesbaden.netsurf.de>

Bigus wrote:

[snipped code]
>>
>>This should not block and print all lines available.
> 
> 
> Thanks but unfortunately not.. it exits after the first line and prints that
> out. I suspect that an eof marker is being sent at the end of each line of
> output from the mailing list system. Actually, just tried commenting out the
> "last if.. eof" line and it still prints out the first line and exits.

That means can_read returns no readable handle on the second loop. Try to 
increase the timeout given to can_read or enter the while loop again after 
       a sleeping period.

Anyway: The server has to have a method of indicating, whether the client 
should read more than one line (like in SMTP or NNTP). i. e. a '-' after 
the three digits of the return code. You should be able to tell whether 
you have read all data or not, because you won't get an eof on the handle.

What protocol is the server using?

Thomas


-- 
open STDIN,"<&DATA";$=+=14;$%=50;while($_=(seek( #J~.> a>n~>>e~.......>r.
STDIN,$:*$=+$,+$%,0),getc)){/\./&&last;/\w| /&&( #.u.t.^..oP..r.>h>a~.e..
print,$_=$~);/~/&&++$:;/\^/&&--$:;/>/&&++$,;/</  #.>s^~h<t< ..~. ...c.^..
&&--$,;$:%=4;$,%=23;$~=$_;++$i==1?++$,:_;}__END__#....>>e>r^..>l^...>k^..


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

Date: Wed, 19 May 2004 19:15:32 GMT
From: "Bigus" <someone@somewhere.com>
Subject: Re: IO::Socket problem
Message-Id: <960fb2f5726123f7ee3412fbc7c98a81@news.teranews.com>

"Thomas Kratz" <ThomasKratz@REMOVEwebCAPS.de> wrote in message
news:40ab7d46.0@juno.wiesbaden.netsurf.de...
> Bigus wrote:
>
> [snipped code]
> >>
> >>This should not block and print all lines available.
> >
> >
> > Thanks but unfortunately not.. it exits after the first line and prints
that
> > out. I suspect that an eof marker is being sent at the end of each line
of
> > output from the mailing list system. Actually, just tried commenting out
the
> > "last if.. eof" line and it still prints out the first line and exits.
>
> That means can_read returns no readable handle on the second loop. Try to
> increase the timeout given to can_read or enter the while loop again after
>        a sleeping period.
>
> Anyway: The server has to have a method of indicating, whether the client
> should read more than one line (like in SMTP or NNTP). i. e. a '-' after
> the three digits of the return code. You should be able to tell whether
> you have read all data or not, because you won't get an eof on the handle.
>
> What protocol is the server using?

TCP. You've helped me alot as it is, but you could probably try it yourself
if you were so inclined. ie: if you register a password here:

http://www.jiscmail.ac.uk/cgi-bin/webadmin?GETPW1=LMGT1

(you get a confirmation mail with a link you have to click on)

and then put your email address & password in the 3rd & 4th lines below,
removing the angle brackets of course. I've set the list to allow a "public"
review, so you don't need to be a list member to see the header.

If you want to see what the review command should return then substitute the
lines from Use IO::Select down to print "@lines" with:

$lsv->print("$cmd\n");
while (my $line = $lsv->getline) {
    print $line;
}

and it'll print the lines & then block.

use strict;
use warnings;
my $email = '<emailaddresshere>';
my $cmd = "review sw-test msg pw=<passwordhere>";

# Connect to Listserv
use IO::Socket;
my $lsv = new IO::Socket::INET( PeerAddr => 'localhost',
    PeerPort => 2306,
    Proto => 'tcp');
$lsv or die "Connection problem :$!";

# Send command header & check return code
my $len = length($email)+length($cmd)+1;
my $bin =
pack("a*CCCa*","\r\n",int($len/256),$len-(int($len/256)*256),length($email),
$email);
$lsv->print("1B".$bin);
my $msg = $lsv->getline;
exit if $msg !~ /^250/;

use IO::Select;
my $sel = IO::Select->new();
$sel->add($lsv);

# Send command
$lsv->print("$cmd\n");

my @lines;
while ( $sel->can_read(0.1) ) {
    #last if $lsv->eof;
    my $line = $lsv->getline;
    push @lines, $line;
}

print "@lines";

# Close socket
close $lsv;

exit;

Regards
Bigus




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

Date: Wed, 19 May 2004 15:10:55 GMT
From: Mothra <mothra@mothra.com>
Subject: Re: iterating over arrays with map - problem
Message-Id: <2OKqc.4832450$iA2.563807@news.easynews.com>

Richard Morse wrote:

> In article <rdJqc.15775781$Of.2631913@news.easynews.com>,
>  Mothra <mothra@mothra.com> wrote:
> 
> 
>>Trying (just for fun) to write my own Perl version of 'Crack' but am
>>stumbling a bit trying to iterate over my dictionary file to generate
<snip>
> 
Thanks - that's put me on the right track.

Although some way to get around the repeated values would make the 
program work much faster - especially as my dictionary file might have 
several thousand words in it.
   :-)


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

Date: Wed, 19 May 2004 15:13:09 GMT
From: Mothra <mothra@mothra.com>
Subject: Re: iterating over arrays with map - problem
Message-Id: <9QKqc.15780590$Of.2632726@news.easynews.com>

Oops!  I just realised - you've done that for me as well!

:-$


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

Date: Wed, 19 May 2004 17:48:47 +0200
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: Meaning of Orthogonality
Message-Id: <40ab8359.0@juno.wiesbaden.netsurf.de>

A. Sinan Unur wrote:

> Edward Wijaya <ewijaya@singnet.com.sg> wrote in
> news:opr79qdvt4uj0cst@news.singnet.com.sg: 
> 
> [ please do not top-post ]
> 
> 
>>On Wed, 19 May 2004 08:43:13 -0000, Edward Wijaya
>><ewijaya@singnet.com.sg> wrote:
>>
>>
>>>Perl is said to be an "orthogonal" programming language.
>>>What does it mean?
> 
> 
>>Mr. Wall said so can be found in Camel Book.
> 
>  
> Could you give a page number please? I would like to see the quotation in 
> context.
> 

PP 3rd Ed, Page 28 footnote:

"Some folks feel that such redundancy is evil because it keeps a language 
from being minimalistic, or orthogonal. But Perl isn't an orthogonal 
language; it's a diagonal language"

Being able to read is an obvious advantage ;-)

Thomas

-- 
open STDIN,"<&DATA";$=+=14;$%=50;while($_=(seek( #J~.> a>n~>>e~.......>r.
STDIN,$:*$=+$,+$%,0),getc)){/\./&&last;/\w| /&&( #.u.t.^..oP..r.>h>a~.e..
print,$_=$~);/~/&&++$:;/\^/&&--$:;/>/&&++$,;/</  #.>s^~h<t< ..~. ...c.^..
&&--$,;$:%=4;$,%=23;$~=$_;++$i==1?++$,:_;}__END__#....>>e>r^..>l^...>k^..


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

Date: Thu, 20 May 2004 00:18:57 -0000
From: Edward Wijaya <ewijaya@singnet.com.sg>
Subject: Re: Meaning of Orthogonality
Message-Id: <opr79u5vc9uj0cst@news.singnet.com.sg>

Yes my mistake....Thanks for correcting me.

On Wed, 19 May 2004 17:48:47 +0200, Thomas Kratz 
<ThomasKratz@REMOVEwebCAPS.de> wrote:

> A. Sinan Unur wrote:
>
>> Edward Wijaya <ewijaya@singnet.com.sg> wrote in
>> news:opr79qdvt4uj0cst@news.singnet.com.sg: [ please do not top-post ]
>>
>>
>>> On Wed, 19 May 2004 08:43:13 -0000, Edward Wijaya
>>> <ewijaya@singnet.com.sg> wrote:
>>>
>>>
>>>> Perl is said to be an "orthogonal" programming language.
>>>> What does it mean?
>>
>>
>>> Mr. Wall said so can be found in Camel Book.
>>
>>  Could you give a page number please? I would like to see the quotation 
>> in context.
>>
>
> PP 3rd Ed, Page 28 footnote:
>
> "Some folks feel that such redundancy is evil because it keeps a 
> language from being minimalistic, or orthogonal. But Perl isn't an 
> orthogonal language; it's a diagonal language"
>
> Being able to read is an obvious advantage ;-)
>
> Thomas
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


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

Date: 19 May 2004 16:19:15 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: Meaning of Orthogonality
Message-Id: <Xns94EE7D561D049asu1cornelledu@132.236.56.8>

Edward Wijaya <ewijaya@singnet.com.sg> wrote in
news:opr79u5vc9uj0cst@news.singnet.com.sg: 

> Yes my mistake....Thanks for correcting me.

You are still top posting. Now we know why.
-- 
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)


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

Date: 19 May 2004 09:22:59 -0700
From: jkeen_via_google@yahoo.com (Jim Keenan)
Subject: Re: Meaning of Orthogonality
Message-Id: <196cb7af.0405190822.5ec0391c@posting.google.com>

Edward Wijaya <ewijaya@singnet.com.sg> wrote in message news:<opr78nubyeuj0cst@news.singnet.com.sg>...
> Perl is said to be an "orthogonal" programming language.
> What does it mean?
> 
Says who?

Can you provide a link to a source so that we could evaluate the
statement/claim in context?

Thank you very much.

Jim Keenan
Brooklyn, NY


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

Date: 19 May 2004 16:33:05 GMT
From: Xaonon <xaonon@hotpop.com>
Subject: Re: Meaning of Orthogonality
Message-Id: <slrncan2uv.eir.xaonon@xaonon.local>

Ned i bach <196cb7af.0405190822.5ec0391c@posting.google.com>, Jim Keenan
<jkeen_via_google@yahoo.com> teithant i thiw hin:

> Edward Wijaya <ewijaya@singnet.com.sg> wrote in message
> news:<opr78nubyeuj0cst@news.singnet.com.sg>...
> 
> > Perl is said to be an "orthogonal" programming language.
> > What does it mean?
> 
> Says who?
> 
> Can you provide a link to a source so that we could evaluate the
> statement/claim in context?

From perlhack, item 2:

-> Does concept match the general goals of Perl?
->     These haven't been written anywhere in stone, but one
->     approximation is:
-> 
->      1. Keep it fast, simple, and useful.
->      2. Keep features/concepts as orthogonal as possible.
->      3. No arbitrary limits (platforms, data sizes, cultures).
->      4. Keep it open and exciting to use/patch/advocate Perl everywhere.
->      5. Either assimilate new technologies, or build bridges to them.

And implicitly from the Camel book, page 219:

-> Since @_ is just a regular array with an irregular name, you can do
-> anything to it you'd normally do to an array.*
-> 
-> * This is an area in where Perl is /more/ orthogonal than the typical
->   programming language.

-- 
Xaonon, EAC Chief of Mad Scientists and informal BAAWA, aa #1821, Kibo #: 1
http://xaonon.dyndns.org/  Guaranteed content-free since 1999.  No refunds.
"Would someone please tackle Donald Rumsfeld and lock his ass up until our
`Countries-Destroyed-to-Countries-Rebuilt' ratio is closer to `1'?" -- GYWO


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

Date: 19 May 2004 10:45:38 -0700
From: chilecayenne@yahoo.com (cayenne)
Subject: Re: noob question: Trying to extract part of a string in a variable to another variable
Message-Id: <2deb3d1.0405190945.f888fa9@posting.google.com>

Richard Morse <remorse@partners.org> wrote in message news:<remorse-79A20D.12400626042004@plato.harvard.edu>...
> In article <2deb3d1.0404250759.7676bbb5@posting.google.com>,
>  chilecayenne@yahoo.com (cayenne) wrote:
> 
> > I have $mail_address = 'fred jones <fred_jones@somewhere.com>'
> > 
> > I want to use regular expressions to just parse out the userid here of
> > fred_jones
> > 
> > I'm trying things like this:
> > 
> > $mail_address =~ /\w+@/;
> 
> What you seem to be asking for is this:
> 
>    my ($user_id) = ($mail_address =~ m/(\w+)@/);
> 
> However, please note that \w doesn't really have the complete set of 
> valid characters to prefix the '@' sign in an email address.
> 
> Just off the top of my head, I know that '.', '-', '?', '=', and more 
> are valid.  Possibly any unicode character other than whitespace and '@' 
> are valid.  It might even be valid to have '<' in an email address.
> 
> At the very least, you probably want
> 
>    my ($user_id) = ($mail_address =~ m/([\w.-+=]+)@/);
> 
> HTH,
> Ricky

Just quickly, can you explain the extensive use of parens here? I
understand the () in the regular expression, to keep those parts the
match...but, what is the function of the () around $user_id and the
entire part after the = sign?

Thanks in advance,

CC


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

Date: Wed, 19 May 2004 14:08:58 -0400
From: Richard Morse <remorse@partners.org>
Subject: Re: noob question: Trying to extract part of a string in a variable to another variable
Message-Id: <remorse-81DADF.14085819052004@plato.harvard.edu>

In article <2deb3d1.0405190945.f888fa9@posting.google.com>,
 chilecayenne@yahoo.com (cayenne) wrote:

> Richard Morse <remorse@partners.org> wrote in message 
> news:<remorse-79A20D.12400626042004@plato.harvard.edu>...
> 
> >    my ($user_id) = ($mail_address =~ m/([\w.-+=]+)@/);
> 
> Just quickly, can you explain the extensive use of parens here? I
> understand the () in the regular expression, to keep those parts the
> match...but, what is the function of the () around $user_id and the
> entire part after the = sign?

Parens around $user_id force the match to happen in a list context.  A 
match in a scalar context would return the number of matches, while in a 
list context, it returns the various matches.

   my $user_id = ($mail_address =~ m/.../)

would have $user_id be the value 1 (because there is one match, as it 
isn't a /g match).

The parens around the match are there because it makes it easier for me 
to read it.  I've never not put them there, although a quick test I just 
did seems to indicate that they aren't necessary.

HTH,
Ricky

-- 
Pukku


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

Date: Wed, 19 May 2004 14:10:07 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: noob question: Trying to extract part of a string in a variable to another variable
Message-Id: <20040519140443.N662@dishwasher.cs.rpi.edu>

On Wed, 19 May 2004, cayenne wrote:

> Richard Morse <remorse@partners.org> wrote in message news:<remorse-79A20D.12400626042004@plato.harvard.edu>...
> >
> >    my ($user_id) = ($mail_address =~ m/([\w.-+=]+)@/);
> >
> Just quickly, can you explain the extensive use of parens here? I
> understand the () in the regular expression, to keep those parts the
> match...but, what is the function of the () around $user_id and the
> entire part after the = sign?
>

The parens around $user_id force the binding operation of =~ to be
evaluated in list context.  This is done because a pattern match in list
context returns a list of all of the captured matches (ie, the things that
go into $1, $2, etc).  This is a shorthand way of writing the two
statements:

$mail_address =~ m/([\w.-+=]+)@/
my $user_id = $1;

The parens around the whole pattern match here are actually unnecessary.
This is because the =~ operator has a higher precedence than the =
operator.  They are likely used here just for clarity, to make sure the
readers of the code are aware that ($user_id) is being assigned to the
return value of the pattern match, rather than the alternate
interpretation of the assignment of $user_id to $mail_address being
pattern matched against the pattern (which would be written like so:
(my $user_id = $mail_address) =~  m/([\w.-+=]+)@/;

Please let me know if this is not clear enough.

Paul Lalli


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

Date: 19 May 2004 11:10:33 -0700
From: krakle@visto.com (krakle)
Subject: Re: Password scheme/Persistent session...
Message-Id: <237aaff8.0405191010.df94e6a@posting.google.com>

"Alan J. Flavell" <flavell@ph.gla.ac.uk> wrote in message news:<Pine.LNX.4.53.0405182028250.22723@ppepc56.ph.gla.ac.uk>...
> > : > You don't need a session. All you need is a password file.
>  
> > : I need a session. .htpasswd does linear style look ups.
> 
> That makes no kind of sense, but is anyway entirely off-topic for
> here.

How doesn't it make sense? Perhaps you don't know what linear is.. And
yes this is off-topic which is why my post WASN'T about .htpasswd.


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

Date: 19 May 2004 11:17:58 -0700
From: krakle@visto.com (krakle)
Subject: Re: Password scheme/Persistent session...
Message-Id: <237aaff8.0405191017.3a45705f@posting.google.com>

"Jürgen Exner" <jurgenex@hotmail.com> wrote in message news:<afyqc.85540$sK3.12505@nwrddc03.gnilink.net>...
> krakle wrote:
> > without utilizing cookies.
> 
> Cookies? Cookies? That doesn't sound like anything related to Perl at all.
> Perldoc says:
>     No documentation for perl FAQ keyword `cookie' found
>     No documentation for perl function `cookie' found

Which is why my post ISN'T about cookies. You guys seem to chop down
my post to where I said "without cookies" and "dont recomment
 .htpasswd" then tell me this newsgroup isn't about cookies or
 .htpasswd when my post didn't even include any cookie or .htpasswd
questions... Are you guys morons or something?

The question IS ontopic to this group. Hell if I was to ask "How do
you execute a perl script" i'd prob. be told it's off topic and
redirected to an OS group instead of someone just saying "perl
<script.pl>".


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

Date: Wed, 19 May 2004 20:09:09 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Password scheme/Persistent session...
Message-Id: <Pine.LNX.4.53.0405191954000.25650@ppepc56.ph.gla.ac.uk>

On Wed, 19 May 2004, krakle leaps straight back into battle without
any sign of having done the indicated research:

> > > : I need a session. .htpasswd does linear style look ups.
> >
> > That makes no kind of sense, but is anyway entirely off-topic for
> > here.
>
> How doesn't it make sense?

The fact that you mentioned .htpasswd indicates that you were
considering a method of authentication.  Apache supports various
authentication techniques.  You haven't shown any cause yet why one of
them would not meet your requirements.

You state, without showing your working, that you "need a session".

If that's truly so, then why were you considering a method of
authentication - which by no means defines a session?  So you
in effect contradicted yourself, while bringing in what you claimed to
be a reason ("linear search") that was completely irrelevant to the
contradiction which you had produced.

On the basis of what you've posted so far, I'd say that readers here
are entitled to conclude that you haven't yet reached a proper
decision about what to implement; so it's hard to believe that you're
ready for Perl-specific advice on how to implement it.  Of course I
could be wrong - obviously we don't have the full background to your
problem, so folks have to respond on the basis of what you chose to
post.

> Perhaps you don't know what linear is..

*giggle*

> And yes this is off-topic

Indeed.  Which is why I shall try to resist dragging this thread out
further.

> which is why my post WASN'T about .htpasswd.

It didn't appear to be about programming in Perl, either, you know.

have fun.


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

Date: Wed, 19 May 2004 14:55:25 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Password scheme/Persistent session...
Message-Id: <slrncanetd.7dm.tadmc@magna.augustmail.com>

Pinocchio <krakle@visto.com> wrote:

> Are you guys morons or something?


Yes we are.

It is useless to post here, so don't.


> The question IS ontopic to this group. 


No it isn't.

It would be ontopic in a newsgroup with some connection to
web stuff. This is not such a newsgroup.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 19 May 2004 13:10:11 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Password scheme/Persistent session...
Message-Id: <40abbf23@news.victoria.tc.ca>

krakle (krakle@visto.com) wrote:
: "Alan J. Flavell" <flavell@ph.gla.ac.uk> wrote in message news:<Pine.LNX.4.53.0405182028250.22723@ppepc56.ph.gla.ac.uk>...
: > > : > You don't need a session. All you need is a password file.
: >  
: > > : I need a session. .htpasswd does linear style look ups.
: > 
: > That makes no kind of sense, but is anyway entirely off-topic for
: > here.

: How doesn't it make sense? Perhaps you don't know what linear is.. And
: yes this is off-topic which is why my post WASN'T about .htpasswd.

Well for one thing you condradicted yourself elsewhere.  You said that
looking up names that start with Z would take longer than names that start
with A (or words to that effect).  However, that would only be true if the
data was sorted, which would imply that apache does something smarter with
the data in .htpasswd than simply doing a "linear style look up".

Anyway, with out looking at the source, or doing careful timing of
 .htpasswd lookups, I wouldn't see any reason to assume that apache does
linear lookups in the first place.  it is just as possible that the files
are (for example) cached in memory in some kind of structure that provides
extremely fast lookup.  Unless the .htpasswd file is being constantly
updated, then this could be very efficient, and sounds quite easy to
implement.


-- 

(Paying) telecommute programming projects wanted.  Simply reply to this.



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

Date: Wed, 19 May 2004 21:02:25 +0100
From: Big and Blue <No_4@dsl.pipex.com>
To: laszlo <GlgAs@Netscape.net>
Subject: Re: perl 5.8.3 problem
Message-Id: <40ABBD51.3090900@dsl.pipex.com>

laszlo wrote:
> 
> Now I upgraded to 5.8.3 and the slide sticks to the 0.0 or 0.1
> positions, can not be moved further.

    Not exactly the case (at least on Linux).

    If you start this up it shows 0.1.

    Click on the R/h end of the (white) bar once.  No change.

    Click again.  The slider now goes to the right and shows 3.0.

    Click on the left of the bar and it goes back to 0.1 and now seems to 
be stuck between 0.0 and 0.1.

    OK - this doesn't fix anything, but it might be a pointer to the fault.

   [And the program runs OK in perl5.6.1 too...]


-- 
      -*-    Just because I've written it here doesn't    -*-
      -*-    mean that you should, or I do, believe it.   -*-


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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.

#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 V10 Issue 6583
***************************************


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