Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Backdating strict

by ikegami (Patriarch)
on Dec 01, 2020 at 09:00 UTC ( [id://11124447]=note: print w/replies, xml ) Need Help??


in reply to Backdating strict

People have mentioned you can avoid going all in by enabling strictures in only some blocks of code at a time. But I don't see any mention of the ability of activating different strictures at different times.

  • You probably aren't violating use strict qw( subs );, so you could start by activating this globally. It only adds compile-time checks, so there's no worries about it finding errors you can't find with perl -c. And in the unlikely event that there happens to be violations, they are super easy to fix.

  • use strict qw( vars ); is the one that will probably result in the most work. It also gives the least value since it might not catch any "real" errors in working code. You can save this one for last, and it can easily be activated on a block-by-block basis. On the plus side, it only adds compile-time checks, so there's no worries about it finding errors you can't find with perl -c.

  • Maybe the stricture that will give you the most bang for the buck is use strict qw( refs );. Violations of this one can be really insidious. Such violations critically need fixing. On the down side, use strict qw( refs ); adds run-time checks, so you have to thoroughly test your code after enabling them.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 05:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found