Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to call a Sub / Function with changing name

by Marshall (Canon)
on Oct 28, 2010 at 22:30 UTC ( [id://868172]=note: print w/replies, xml ) Need Help??


in reply to How to call a Sub / Function with changing name

Make a dispatch table:
#!/usr/bin/perl -w use strict; my %dispatch = ( 'immunizations' => \&immunizations, 'allergies' => \&allergies); sub immunizations { print "inside immunizations\n"; } sub allergies { } $dispatch{'immunizations'}->(); #prints: inside immunizations

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2026-02-18 05:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.