Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: use strict without typing use strict?

by hippo (Bishop)
on May 26, 2021 at 09:23 UTC ( [id://11133046]=note: print w/replies, xml ) Need Help??


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

If you wanted to use that all the time, then PERL5OPT is one solution:

$ export PERL5OPT='-Mstrict' $ perl -e '$x = 1; print qq{$x\n}' Global symbol "$x" requires explicit package name at -e line 1. Global symbol "$x" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors. $

🦛

Replies are listed 'Best First'.
Re^3: use strict without typing use strict?
by Fletch (Bishop) on May 26, 2021 at 12:53 UTC

    One caveat to keep in the back of your mind if you dabble with PERL5OPT: every arbitrary perl you may run will see that and (try to) honor it. At $work we've got some stuff therein that works fine when run with our separate application copy of a newer version, but woe be unto the person that manages to mungle their PATH and instead wind up getting the (long in the tooth) OS' /usr/bin/perl instead because there's modules pulled in which have a newer use 5.xx constraint and there's much errors and blowing up and the not running (GLEIVEN!</bad professor frink>).

    Probably not an issue WRT just a PERL5OPT="-Mstrict" but be aware of that limitation if you start getting fancier.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11133046]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-03-28 19:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found