$ perl -MO=Deparse -e ' > package main; > use Test; > use constant DEBUG => 0; > my $t = Test->new(); > > package Test; > use constant DEBUG => 0; > sub new { > print "Test->new(@_)" if ( DEBUG || main::DEBUG() ); > # ... > } > ' use Test; use constant ('DEBUG', 0); my $t = 'Test'->new; package Test; sub BEGIN { require constant; do { 'constant'->import('DEBUG', 0) }; } sub new { 0; } -e syntax OK
In reply to Re: use constant and the Perl Optimizer
by mreece
in thread use constant and the Perl Optimizer
by Outaspace
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |