Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^2: no strict refs for blocks?

by Sewi (Friar)
on Nov 02, 2011 at 11:44 UTC ( #935359=note: print w/replies, xml ) Need Help??

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

Thank you, this is the link I didn't find earlier.

The "no strict refs" is valid, but the additional "use strict refs" is a NOOP.

Replies are listed 'Best First'.
Re^3: no strict refs for blocks?
by bart (Canon) on Nov 02, 2011 at 11:48 UTC
    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.
      Or he couldn't remember whether strict was lexically scoped and so did the safe thing.
      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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935359]
[LanX]: (not a high priority bug because I can use some HTML entities in the second string)
[Corion]: base64 is padded to a multiple of 4 chars (or something)
[LanX]: misunderstanding, I joined them before converting to base64
[Corion]: Also, I would be wary of encodings and try to make really sure that both input strings are UTF-8. Maybe join the input strings from one source together to see whether they decode as bad or not
[Corion]: LanX: Then the problem should persist without encoding to base64 too ;)
[LanX]: I think it's a flag problem ... I'll produce a reprodocable example for SOPW
[Corion]: "flag problem" to me sounds like "contains UTF-8 bytes but was never properly decoded to an UTF-8 string"
[LanX]: not my code ...
[choroba]: yeah, sounds like one of the strings is not flagged as UTF-8
[choroba]: which usually means its input wasn't handled correctly

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2017-01-16 13:55 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (150 votes). Check out past polls.