in reply to Re: how to find a key from a hash
in thread how to find a key from a hash

wouldn't
$key = shift(keys(%hash));
be perfectly adequate?
How could something that doesn't even have a remote chance of compiling be "perfectly adequate"?

shift, but it's nature, must have an lvalue as its argument, and to be more precise, an lvalue that starts with an @. List context keys() is neither. shift isn't an alternative for [0].

Perl --((8:>*

Replies are listed 'Best First'.
Re^3: how to find a key from a hash
by swampyankee (Parson) on Nov 21, 2005 at 16:17 UTC

    Because I went into idiot mode; it tends to happen often on Mondays.

    emc