in reply to Re: All uppercase subs
in thread All uppercase subs
Using perl -w -MO=Deparse test.pl, the outcome is:use constant DEBUG => 0; if(DEBUG) { print "This will be gone.\n"; } else { print "Hello, world!\n"; }
with the equivalent code using Readonly,BEGIN { $^W = 1; } use constant ('DEBUG', 0); do { print "Hello, world!\n" }; test.pl syntax OK
I get this instead:use Readonly; Readonly $DEBUG => 0; if($DEBUG) { print "This will be gone.\n"; } else { print "Hello, world!\n"; }
BEGIN { $^W = 1; } use Readonly; Readonly $DEBUG, 0; if ($DEBUG) { print "This will be gone.\n"; } else { print "Hello, world!\n"; } test.pl syntax OK
|
|---|