[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] pop (keys %hash) ?



On Fri, Jun 18, 1999 at 09:55:32AM -0700, jean-Francois Jobidon wrote:
> @listKeys = (keys %hash);
> $lastkey = pop @listKeys;
> 
> I'd like to know if there is a way to write this code
> on one line. Something like :
> 
> $lastkey = pop (keys %hash);
> 
> Perl tells me that the argument must be an array.

Uh, what exactly are you trying to accomplish?  Hashes are not sorted, so
there is very little significance to the 'last key' in a hash.

Ronald

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org