Rob Dixon wrote:
> 
> I don't think so. $#array returns the index of the last existent element of 
> the
> array. The one which pop() will delete and return, and the one after which
> push() will add an element.
> 
> I'm not sure what you mean about 'while', but an array evaluates as true if it
> has any existent elements.
> 
> 'for' iterates over a list, and Perl derives a list from an array by inserting
> undefined values where there are non-existent elements before the end of the 
> array.
> 
> It may not be fully documented but it is all self-consistent and works well.

I have since found an anomaly, being that

  my $item = pop @array;

is different from

  my $item = delete $array[-1];

in that pop() vivifies undefined elements beneath the popped one, whereas
delete() leaves them alone.

Rob

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to