> -----Original Message-----
> From: John W. Krahn [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 19, 2002 4:17 PM
> To: [EMAIL PROTECTED]
> Subject: Re: newbie question
> 
> 
> Bob Showalter wrote:
> > 
> > ...consider if $| were -1 prior to the increment).
>            ^^^^^^^^^^^^^
> 
> It's not going to happen Bob!  :-)  $| is very magical and 
> can only hold
> the values zero and one.
> 
> $ perl -le'for (-5, -1, 0, 1, 5) {$| = $_; print $|}'
> 1
> 1
> 0
> 1
> 1
> 
> 
> Also, $| has an interesting property when you decrement it.
> 
> $ perl -le'for (1 .. 6) {$|--; print $|}'
> 1
> 0
> 1
> 0
> 1
> 0
> 
> Which it doesn't have when you increment it.
> 
> $ perl -le'for (1 .. 6) {$|++; print $|}'
> 1
> 1
> 1
> 1
> 1
> 1

In the words of Johnny Carson, "I did not know that!". :~) Thanks for
educating me.

I'm stickin by my story though. I would use $| = 1 and $| = 0 to make sure
that Perl DWIM!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to