in reply to Re: simple array condition
in thread simple array condition

There's something very wrong happening or I am smoking crack.
@array[9..13] is an array slice which evaluates to a list which in turn evaluates to its last component in scalar context!
So defined @array[9..13] is just an equivalent of defined($array[13]), is it not???

Replies are listed 'Best First'.
Re: Re: Re: simple array condition
by particle (Vicar) on Apr 13, 2002 at 14:53 UTC
    you are indeed correct. my code's been a little off lately. i'm a little out of practice, stuck in ksh all day. correct (but a little hard to read) would be:

    defined $_ && $_ ne '' && my_sub($_) for @array[9..13];

    ~Particle ;Þ