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

Re: Question on "my" in the variables

by sundialsvc4 (Monsignor)
on Feb 25, 2014 at 01:51 UTC ( #1076072=note: print w/ replies, xml ) Need Help??


in reply to Question on "my" in the variables

Simply stated, “the real objective here is:

When you are about to shoot yourself in the foot(!!) ... it is much better for the computer to go ‘click’ than to go ‘BANG!!’.

If you “simply” declare all variables to be global, then the ever-accommodating “I presume that you know what you are doing” Perl language will generally try its best to accommodate you.   However, you probably would much prefer that it should detect as many of your errors as possible.   Instead of telling Perl that variables should have the widest possible scope, you probably want to be as specific as possible, and then to use strict; use warnings; so that the computer will have the greatest possible chance of detecting your unintended screw-ups.   Instead of letting Perl run amok, let Perl decline to run your code at all.

Execution-speed is really not the point:   no one is in a hurry to get the wrong answers (or, far worse, “unexplainable but obviously-wrong behaviors”) quickly.


Comment on Re: Question on "my" in the variables
Re^2: Question on "my" in the variables
by AnomalousMonk (Monsignor) on Feb 25, 2014 at 04:06 UTC

    ... or far, far, far worse, apparently correct behavior that is only discovered (and discovered, inevitably, in full view of your colleagues/boss/client/the world) to be wrong after a program has run for weeks or months and corrupted some vital database or transaction history that can only be corrected with vast effort and expense — if you're lucky and it can be corrected at all!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2014-07-22 14:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (114 votes), past polls