Is it that important that there be only one variable for the entire application? Why not just
sub f { our $OnceOnly{+__LINE__} ||= (log(...),1); }
which would, ISTM, be largely equivalent (and somewhat simpler), but with no risk of warnings?
In reply to Re: Why do I get a "used only once" warning here?
by Porculus
in thread Why do I get a "used only once" warning here?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |