Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: variable sub function?

by c-era (Curate)
on May 30, 2002 at 14:26 UTC ( #170391=note: print w/replies, xml ) Need Help??


in reply to variable sub function?

You could probably use typeglobs. Here is an example:
sub mySub { print "this sub\n"; } *mySub2 = \&mySub; mySub2();
And just repeat '*mySub2 = \&mySub' for each sub you need to setup (changing the name of mySub2).

If you want to learn more about typeglobs, I recomend Advanced perl programming (there are a lot of other goodies in there as well).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (1)
As of 2022-01-23 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?