in reply to Re: Weird function calling...
in thread Weird function calling...

Well, if you're not using the key, don't ask for it:
$foo->$_ for values %Movement;

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Re: Weird function calling...
by robin (Chaplain) on Jan 07, 2002 at 23:42 UTC
    I must admit I'd assumed that dragonchild was using the key, but had omitted it from the example code for the sake of simplicity. Why use a hash at all, otherwise? But I shouldn't make assumptions without mentioning them.

    Your code is very neat and concise, but if the hash is large, it may be impractical to dump all the values onto the stack. each really has much nicer semantics, even if it's slightly more cluttered syntactically. Of course, when we get lazy lists in Perl 6 we might be able to have both at once :-)