The OPer seems to want to control one-time printing/logging from outside the package/module
If one really wants a global in some other package, then...
package MyModule; use strict; use warnings; sub f { $MyApp::OneTime{+__FILE__.' '.__LINE__} ||= (print("logging\n"), 1 +); return(); } 1;
In reply to Re^3: Why do I get a "used only once" warning here?
by ig
in thread Why do I get a "used only once" warning here?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |