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.
In reply to Re: Why do I get a "used only once" warning here?
by JavaFan
in thread Why do I get a "used only once" warning here?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |