Dan Sugalski wrote: > At 5:28 PM +0200 8/1/02, Aldo Calpini wrote: >>fetching an element out of bound changes the >>length of the array. but should this really happen? > > Because that's the way Perl's arrays work. Joys of > autovivification.
I have to disagree. the corresponding Perl script does not show this behaviour: my @a = (undef) x 100; print "length=", scalar(@a), "\n"; print "a[0]=", $a[0], "\n"; print "length=", scalar(@a), "\n"; print "a[10000]=", $a[10000], "\n"; print "length=", scalar(@a), "\n"; the output is: length=100 a[0]= length=100 a[10000]= length=100 cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;