Keep It Simple, Stupid | |
PerlMonks |
Re: Declaring a code ref with argumentsby BrowserUk (Patriarch) |
on Aug 05, 2003 at 09:13 UTC ( [id://280929]=note: print w/replies, xml ) | Need Help?? |
The simple answer is that you cannot store a coderef with arguments. What would that mean if you could?
If you really want the sub to always have the same argument(s), then they aren't argument(s)--they are constant(s) :) -- so code the sub that way.
Problem solved:) However, if you want to pass different arguments when you invoke the coderef, do so.
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller If I understand your problem, I can solve it! Of course, the same can be said for you.
In Section
Seekers of Perl Wisdom
|
|