Just another Perl shrine | |
PerlMonks |
•Re: constant and eval (are they enemies?)by merlyn (Sage) |
on May 22, 2002 at 20:52 UTC ( [id://168580]=note: print w/replies, xml ) | Need Help?? |
Let's say you wanted to make CONSTANT1 be 1, CONSTANT2 be 2, and so on.
This loop does the same as constant:
It's important that $num here be a closure variable, so that all five coderefs are distinct. You should be able to extrapolate this strategy to your application. -- Randal L. Schwartz, Perl hacker
In Section
Seekers of Perl Wisdom
|
|