use warning; use strict; { my %log_seen; sub log_info { # do not continue if done before return if $log_seen{(caller(1))[3]}++; warn(@_, "\n"); } } sub f { log_info('some information'); print "called f()\n"; } f(); f(); __END__ some information called f() called f()
In reply to Re: Why do I get a "used only once" warning here?
by repellent
in thread Why do I get a "used only once" warning here?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |