Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^7: Help! My variables are jumping off a cliff!

by JavaFan (Canon)
on Feb 27, 2012 at 08:45 UTC ( [id://956402]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Help! My variables are jumping off a cliff!
in thread Help! My variables are jumping off a cliff!

you declare a variable in one part of a large program. Later, when adding code, you unintentionally declare the same variable again in another part of the program. You've just smashed the first one, and caused errors in any code that depended on it.
Unfortunally, it's impossible to determine whether any further uses of said variable depend on the original one (then there's an error), or on the new one (then using the same name is harmless). That's why Perl gives you a warning. A warning after all means "heh, coder, I spotted something that may be an error. But I can't know for sure, I'm just carrying on, cause, you know, I'm often quite mistaken about this".

Just because you made a boo-boo in your code, that you didn't spot because you weren't running with warnings doesn't mean you now have a reason to claim "use strict" is broken. It's not. Your code was.

  • Comment on Re^7: Help! My variables are jumping off a cliff!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2024-04-18 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found