[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: exists $foo[7] and delete $foo[7]



Hi,

Tom Christiansen:
>     @array = qw/zero one two three/, undef, 'five';
> 
> Why do we care to distinguish between $array[4] and $array[17] above?
> IF we undef $array[1], why should that be different that the status 
> fo $array[17]? 
>
That does matter at the end of an array -- foo() is different from
foo(undef), thus their $_[0]'s are different.

IMHO it's nice to have a test for this without refering to the array
length.

On the other hand... -- another semantic question for this modification:

@a = () and $a[1]="foo" and exists($a[0])  --  true or false?

-- 
Matthias Urlichs  |  noris network GmbH   |   smurf@noris.de  |  ICQ: 20193661
The quote was selected randomly. Really.    |      http://www.noris.de/~smurf/
-- 
I don't have a drinking problem.
   I drink.
   I get drunk.
   I fall down.
   No problem.


Follow-Ups from:
Gurusamy Sarathy <gsar@activestate.com>
References to:
Tom Christiansen <tchrist@chthon.perl.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]