Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: subroutine ref while "strict refs"

by Anonymous Monk
on Jul 28, 2014 at 09:24 UTC ( [id://1095314]=note: print w/replies, xml ) Need Help??


in reply to subroutine ref while "strict refs"

One way is a dispatch table:

sub quz { ... } my %dtbl = ( foo => sub { ... }, bar => sub { ... }, quz => \&quz, # etc. ); my $sub_routine = "quz"; $dtbl{$sub_routine}->($value1,$value2);

By the way, your input file looks like something you might want to read via Text::CSV.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found