- or download this
$MyApp::once{x} ||= 1;
- or download this
sub f {
...
log('some information'); # but should be called only the first time.
...
}
- or download this
static LogRetType const once=log('some information');
- or download this
my $once1=0;
sub f {
...
$once1 ||= (log('some information'),1);
...
}
- or download this
sub f {
...
$MyApp{+__FILE__.' '.__LINE__} ||= (log('some information'),1);
...
}