in reply to Weird function calling...
then you avoid the problem altogether, and you also avoid having to drop the whole key list onto the stack and dereference the hash needlessly.while (my ($key, $func) = each %Movement) { $foo->$func; }
I think each is underused, and is a better idiom for many loops which use keys.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Weird function calling...
by merlyn (Sage) on Jan 07, 2002 at 23:31 UTC | |
by robin (Chaplain) on Jan 07, 2002 at 23:42 UTC |