emilford has asked for the wisdom of the Perl Monks concerning the following question:
Now suppose that $formdata{'action'}=setup. If I wanted to call the function &get_events while passing the parameters stored in args, how would I call this? This is what I have so far, but it's not working. I probably have a bracket or paren swapped around or something.my %functions = ( "setup" => { function => \&get_events, args => [\%formdata, $filelocation] }, );
Any help is appreciated.$functions{$formdata{'action'}}->{function}->($functions{$formdata{'ac +tion'}}->{args});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: passing hash elements as parameters
by hiseldl (Priest) on Oct 09, 2002 at 18:42 UTC | |
by emilford (Friar) on Oct 09, 2002 at 19:14 UTC | |
by hiseldl (Priest) on Oct 09, 2002 at 20:32 UTC | |
by robartes (Priest) on Oct 09, 2002 at 20:37 UTC | |
by emilford (Friar) on Oct 09, 2002 at 19:03 UTC | |
|
Re: passing hash elements as parameters
by runrig (Abbot) on Oct 09, 2002 at 18:32 UTC | |
by emilford (Friar) on Oct 09, 2002 at 19:00 UTC |