Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: reference to a sub

by TedPride (Priest)
on Sep 11, 2005 at 10:29 UTC ( [id://491050]=note: print w/replies, xml ) Need Help??


in reply to reference to a sub

Well, what if you have several different subs, one of which is to be chosen and used throughout your program based on the contents of a variable? You can either test the variable at each point in the program, duplicating your code and making an ugly mess, or you can test once and assign the sub reference to a variable, which is then used from then on.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 01:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found