in reply to Getting last value in array

this should do it as well my $lastvalue = pop(@array);

Replies are listed 'Best First'.
Re: Re: array
by ichimunki (Priest) on Jul 18, 2002 at 20:32 UTC
    Sara/DS/Amoura/whatever, the pop(@array) function is destructive. It will remove the last element from the array (just as shift will remove the first element), it is therefore not a good substitute for $array[-1] under most circumstances. If you don't mind that your array will now be incomplete pop away. :)
Re: Re: array
by DS (Acolyte) on Jul 18, 2002 at 19:59 UTC
    thanks all that was quick :)