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

Re: -E behavior with stdin script (updated x2!)

by haukex (Bishop)
on Sep 05, 2021 at 07:42 UTC ( #11136456=note: print w/replies, xml ) Need Help??


in reply to -E behavior with stdin script

Note -E doesn't turn on strict, AFAICT its equivalent is -Mfeature=:all.

Update: Sorry, that's not quite right - :all also enables experimental features and features that were removed from feature bundles of later versions, like array_base. I showed a slightly hackish workaround here.

Update 2: Here's an improved version that gives exactly the same result as the -E switch:

use Config; use feature ":$Config{PERL_REVISION}.$Config{PERL_VERSION}";

Replies are listed 'Best First'.
Re^2: -E behavior with stdin script
by almr (Acolyte) on Sep 05, 2021 at 09:28 UTC

    Ah. I was getting confused. So the least-verbose choices become, I think,

    • [-Mstrict] -Mfeature=:all -- - <<EOF to run a stdin script
    • [-Mstrict] -E script to run a stringified script
    • -Mv5.28 {-e script | -- -} (as of now) to require a recent perl with all security & unicode fixes, turn on strict, and run either a stdin or a stringified script.
      The least verbose option would be -MMyDefaults, where you write a module named MyDefaults that sets all the bits as you prefer and then you install that on each system you use :-)
      -Mfeature=:all

      Sorry, I made a mistake, that's actually not exactly equivalent to -E, please see the updates in my node above.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2022-01-28 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?