in reply to Why do I get a "used only once" warning here?
We don't have local statics in Perl,What's wrong with state? Seems to me:
will do.sub f { state $once1 = log('some information') || 1; }
As for the warning in your solution, that's the stuff no warnings is for. I don't get the point of not wanting to use it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why do I get a "used only once" warning here?
by tilly (Archbishop) on Mar 13, 2009 at 16:10 UTC |