From: Monty <[EMAIL PROTECTED]>
> Thanks for all the replies, both in this group and in separate e-
> mails.
>
> Things have been cleared up. My major misunderstanding was in the
> fact that $1, $2, etc. can exist outside the RegEx. I previously
> thought they had to be confined to the expressio
Thanks for all the replies, both in this group and in separate e-
mails.
Things have been cleared up. My major misunderstanding was in the
fact that $1, $2, etc. can exist outside the RegEx. I previously
thought they had to be confined to the expression itself. Through
some experimenting I find
Paul Lalli wrote:
On Jul 5, 10:49 am, [EMAIL PROTECTED] (Monty) wrote:
next unless /^(\S+)/;
$who{$1}++;
}
It's the 'next' line I'm unclear on. I know that results: parse the
first field from each output line of the 'who' command, but I'm
wondering why this might have been done in thi
On Jul 5, 10:49 am, [EMAIL PROTECTED] (Monty) wrote:
> I'm reading "Network Programming with Perl" by Lincoln Stein, and I've
> come across a snippet of code I'mnot quite following:
>
> open (WHOFH, "who |") or die "Can't open who: $!";
>
> While () {
Please configure your mail/newsreader not to r
On 7/5/07, Monty <[EMAIL PROTECTED]> wrote:
I'm reading "Network Programming with Perl" by Lincoln Stein, and I've
come across a snippet of code I'mnot quite following:
open (WHOFH, "who |") or die "Can't open who: $!";
While () {
next unless /^(\S+)/;
$who{$1}++;
}
That should be "w
From: Monty <[EMAIL PROTECTED]>
> I'm reading "Network Programming with Perl" by Lincoln Stein, and I've
> come across a snippet of code I'mnot quite following:
>
> open (WHOFH, "who |") or die "Can't open who: $!";
>
> While () {
> next unless /^(\S+)/;
> $who{$1}++;
> }
>
> It's the 'n
Monty wrote:
I'm reading "Network Programming with Perl" by Lincoln Stein, and I've
come across a snippet of code I'mnot quite following:
open (WHOFH, "who |") or die "Can't open who: $!";
While () {
'While' is an error. What the code probably said was 'while' (Perl is case
sensitive.)
Th