Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Access functions by name

by llancet (Friar)
on Jun 16, 2009 at 07:29 UTC ( #771912=note: print w/replies, xml ) Need Help??


in reply to Access functions by name

If all of the functions are sure, you may call the functions by names in this way:
my %func_map={ "function1" => \&function1, "function2" => \&function2, # ..... }; # while you got a name, call the corresponding function my $name=some_way_you_got_it(); &{$func_map{$name}}($your_param1,$your_param2);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://771912]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2021-10-25 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (89 votes). Check out past polls.

    Notices?