Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: calling subroutines from variables

by bman1974 (Initiate)
on Aug 21, 2008 at 17:21 UTC ( [id://705887]=note: print w/replies, xml ) Need Help??


in reply to Re: calling subroutines from variables
in thread calling subroutines from variables

Thanks, I will try the building the hash. I was looking at that and wanted to see if there were other options. For this particular problem that is the way to go.
Thanks, B
  • Comment on Re^2: calling subroutines from variables

Replies are listed 'Best First'.
Re^3: calling subroutines from variables
by gone2015 (Deacon) on Aug 21, 2008 at 18:01 UTC

    Of course, if you have a lot of subroutines, you may still want symbolic refs to help construct the hash:

    my %dispatch = map { ; no strict 'refs' ; ($_, \&$_) } qw(sub1 sub2 +sub3 ...) ;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-20 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found