When a variable contains "a reference," anything that you do to it is automatically and transparently conveyed to act upon its "target." But, that very same variable could at some time cease to contain a "reference" value and, instead, contain an ordinary scalar value, in which case it would behave altogether differently than before.

From perlref:

References are easy to use in Perl. There is just one overriding principle: in general, Perl does no implicit referencing or dereferencing. When a scalar is holding a reference, it always behaves as a simple scalar. It doesn't magically start being an array or hash or subroutine; you have to tell it explicitly to do so, by dereferencing it.

You are once again completely, utterly wrong. Dereferencing is a general concept that applies to many programming languages.

Your posting history has revealed your business model:

Step 1: Market yourself as someone who fixes "legacy software projects that have wandered far off-course", i.e. cleaning up others' messes

Step 2: Troll programming websites and (a) spread misinformation to those seeking help and (b) cause other professional Perl devs to waste their time proofreading and correcting you instead of helping people

Step 3: Profit!

Your LinkedIn profile claims you were an instructor at Scottsdale Community College. I can only assume you used the same approach there, training the next generation of bad programmers. Well, I guess us average Perl devs might be thankful to you for screwing the curve and making us look better. Or maybe you already recognized that and are getting paid for this service by other developers - that'd be quite a racket!


In reply to Re^2: Global variable unexpectedly modified when passed by reference by Anonymous Monk
in thread Global variable unexpectedly modified when passed by reference by fshrewsb

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, 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.