Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: reference to a subby TedPride (Priest) |
on Sep 11, 2005 at 10:29 UTC ( [id://491050]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|