in reply to Weird function calling...

What about:
foreach my $key (keys %Movement) {
    &foo->$Movement{$key};
}

Replies are listed 'Best First'.
Re: Re: Weird function calling...
by runrig (Abbot) on Jan 09, 2002 at 01:09 UTC
    Well, that doesn't work. You've got your syntax and data types all mixed up. 'foo' is not a subroutine, its a blessed object (and a scalar), and $Movement{key} is a method name (just a scalar and a string). If $foo were a subroutine reference and $Movement{key} were an argument to the subroutine, you could say:
    $foo->($Movement{$key});
    But that's not the case here either.