On Mon, Sep 24, 2001 at 12:09:19PM -0400, David H. Adler wrote:
> On Mon, Sep 24, 2001 at 11:35:19AM +0200, Paul Johnson wrote:
> > On Mon, Sep 24, 2001 at 01:15:06AM -0400, David H. Adler wrote:
> > 
> > > On the other hand, given the wording of this, I find this slightly
> > > odd:
> > > 
> > >   bash-2.05$ perl -e ' $i = (-3..0);print "*$i*\n"'
> > >   **
> > > 
> > > ...as the right operand is false.
> > > 
> > > Or am I misreading this?
> > 
> > I think that what you are missing is that .. compares its constant
> > operands to $.  Thus it is only really useful within an input loop and
> > with numbers which can match $.
> > 
> > In this case $. != -3 so $i is false.
> 
> In that case, why does (0..4) return a false value? The comparison of 0
> to $. is true,

$. isn't unundefed until it's read from:

$ perl -lwe 'print $.; <>; print $.'
Use of uninitialized value in print at -e line 1.

some stdin
1
$

Paul

Reply via email to