in reply to Re: Re: Re: where to look up "funny looking" perl notation (and an example)
in thread where to look up "funny looking" perl notation (and an example)

For getting the 'last defined index' in an array - if you are using it as a subscript - I prefer $array[-1] = $foo; over $array[$#array] = $foo;

$#array is still useful if you are looping over an array by index, like this

for my $i (0..$#array) { # do something with $array[$i] }

-- Hofmator