Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: no strict refs for blocks?

by bart (Canon)
on Nov 02, 2011 at 11:48 UTC ( [id://935362]=note: print w/replies, xml ) Need Help??


in reply to Re^2: no strict refs for blocks?
in thread no strict refs for blocks?

but the additional "use strict refs" is a NOOP.
Actually, it would reenable strict for any code below in the remainder of the block. Here it is indeed not doing anything. Probably the person who wrote this snippet copy/pasted it from somewhere else without knowing why the "use strict" was there (typically known in the Perl world as "cargo culting"); or else, there might have been some code below it, which got deleted, and this just stuck.

Replies are listed 'Best First'.
Re^4: no strict refs for blocks?
by jethro (Monsignor) on Nov 02, 2011 at 12:57 UTC
    Or he couldn't remember whether strict was lexically scoped and so did the safe thing.
Re^4: no strict refs for blocks?
by Anonymous Monk on Nov 04, 2011 at 12:51 UTC
    The "safe" thing, or maybe, the "crystal clear" thing. Say what you mean, because you're talking not just to a compiler but to a human. Comment on why you've put the directive here, and then put a counter-directive in as soon as you no longer intend for the previous one to apply. Who really cares if the compiler does anything different in response to it or not ... your intentions are now clear.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 15:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found