Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: use strict without typing use strict?

by haj (Vicar)
on May 26, 2021 at 06:15 UTC ( [id://11133040]=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?

You can turn on strict with use 5.12.0; or any explicit later version, but that's not a great way of just turning on strict because you may get unexpected side effects or limit functionality when using newer version of Perl.

I recommend to add a use $VERSION; anyway, but not 5.12.0 unless you've actually tested your code under that version. It doesn't limit functionality: If you need functionality from a newer version of Perl, you're well advised to adjust to that version in the use statement.

Unexpected side effects can occur if you add a version declaration to legacy code which hadn't one, but if you start writing your code with a version declaration, you can look it up what side effects are to expected from bumping that version.

  • Comment on Re^2: use strict without typing use strict?

Replies are listed 'Best First'.
Re^3: use strict without typing use strict?
by GrandFather (Saint) on May 26, 2021 at 06:49 UTC

    I had experimental features in mind when I mentioned "limit functionality". I agree with your observations. My key point is that using a specific version just to enable strict isn't a great idea.

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-04-19 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found