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

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



Tom Christiansen <tchrist@chthon.perl.com> writes:
>
>I really don't understand why there should be a difference then between
>delete and undef.  And if there's no difference, delete shouldn't be there.

The same could have been said for hashes - 

   undef $hash{'foo'};
and 
   delete $hash{'foo'};

are only distinguishable with exists.

We have found uses for the distinction in hashes.
We could for arrays too - e.g. tie'ing and array to a sparse file.

-- 
Nick Ing-Simmons


References to:
Tom Christiansen <tchrist@chthon.perl.com>

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