[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: exists $foo[7] and delete $foo[7]
>>>>>> "Tom" == Tom Christiansen <tchrist@chthon.perl.com>
>>>>>> wrote the following on Thu, 13 Jan 2000 13:25:26 -0700
> >> Funny, I am always wondering why perl suddenly claims there are
> >> 101 elements when I'm fairly sure I've only set 1.
> Tom> Funny, I don't recall Perl ever saying that.
>perl -e '$a[100] = "something"; print scalar(@a)'
>101
That's not what it's saying. It's saying that the 101st
item in the array has been assigned to. It's not saying
there are 101 defined things in the array.
--tom
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]