Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
One may say that this effect may be avoided by remembering to carefully localize all package variables in all called functions,

Unintended side effects are unintended side effects:

sub G { our @ydata = 'Gaaaahh!'; };; sub F{ my @a = @_; print qq{pre-G: (@ydata)}; G(); print qq{post-G: (@ydata)}; };; F(1..4);; pre-G: () post-G: (Gaaaahh!)

The problem has nothing to do with aliasing and everything to do with not localising!

Your previous quote is better stated as: "don't use code that uses globals for no good reason.".

Which is doubly true for code that fails to localise its use of globals.

a healthy dose of paranoia.

Sorry, but I will always consider 'paranoia' in programming -- and pretty much everything else for that matter -- with exclusively negative connotations.

The teaching of 'paranoia', rather than 'knowledge', in an attempt to avert disaster, is always a counter productive and ultimately futile process.

With paranoia, one can only hope to avert bad consequences; with knowledge one can know you have.

Don't hope, know!


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^4: aliasing arrays using typeglob under strict by BrowserUk
in thread aliasing arrays using typeglob under strict by RockyMtn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (8)
    As of 2015-07-08 00:23 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (93 votes), past polls