in reply to Re^4: Using a scalar as a constant?
in thread Using a scalar as a constant?
You can even do it in a strict safe manner :)
use constant test => 5; if(my $sub = __PACKAGE__->can('test')) { print $sub->(),"\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Using a scalar as a constant?
by JavaFan (Canon) on Oct 15, 2008 at 15:24 UTC | |
by chromatic (Archbishop) on Oct 15, 2008 at 17:27 UTC | |
by suaveant (Parson) on Oct 15, 2008 at 16:09 UTC |
In Section
Seekers of Perl Wisdom