in reply to Re: use strict without typing use strict?
in thread use strict without typing use strict?

Well in theory he could set the environment with PERL5OPT=-Mstrict or manipulate sitecustomize.pl (see perlrun for details) ...

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...:)

Replies are listed 'Best First'.
Re^3: use strict without typing use strict?
by eyepopslikeamosquito (Archbishop) on May 26, 2021 at 09:35 UTC

    Good catch. Totally forgot about PERL5OPT. :)

    Just in case this is an XY Problem, I'd be interested to learn the underlying real reason why the OP wants to do this. Just for personal convenience? Or is there an organisational back story, perhaps trying to control what others do?