D:\tmp>set PERL5OPT=-Mstrict D:\tmp>perl -ce "$fred = 42" Global symbol "$fred" requires explicit package name (did you forget t +o declare "my $fred"?) at -e line 1. -e had compilation errors.
... but I would hate the side effect of random errors, if the script was accidentally run in another environment and strict was missing.
The safest would be to alias/link perl to a new name like superl - the "super language" ;) - which auto-defaults to strict.
Like this superl script.pl would simply not run if the workaround was missing.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
PS: On a side-note: The whole Perl7 mess could be solved like this too! (The language needs a rebranding anyway to overcome the mobbing. Don't shoot the messenger...:)
In reply to Re^2: use strict without typing use strict?
by LanX
in thread use strict without typing use strict?
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |