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

Re^3: Global variable unexpectedly modified when passed by reference

by sundialsvc4 (Abbot)
on Dec 09, 2014 at 17:30 UTC ( #1109784=note: print w/replies, xml ) Need Help??


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

BrowserUK, the very least that you can do, before spewing-off like that, is to have the professional courtesy to do so under your own name, thus to accept responsibility for the downvotes, if not outright post-deletion, that such a thing would so richly deserve.

That being said, this entire reply is vitriolic rubbish which, I assure you, will receive no further time and attention from me.

I do, however, wish to clarify the technical point.

Yes, “dereferencing” is a well-known, tried-and-true programming language concept, as is the notion of “a reference as a data-type,” which is especially useful for “compile-time typeless” languages such as Perl.   No one is suggesting otherwise.   But a lot of people do become confused by it ... and by the process of debugging it.

Point-of-fact, the exact scenario that I referred-to came directly from a very nasty debugging-situation that I helped to shoot down.   A statement such as foobar := 2; had two entirely different side-effects, one of them wanted, the other one not, depending on whether-or-not the value that foobar currently held was “its own self-contained scalar” or “a reference [to God-knows-what].”   It was an extremely difficult problem to identify ... first, for determining what-the-hell was happening, then to figure out how a reference-value wound up being assigned to foobar in the first place.   (This well-buried problem, some distance away and some time away, was “the root cause of the problem.”)   The behavior was not deterministic ... the erroneous (reference ...) value was assigned to foobar only under certain run-time conditions.   Thence the bug, which cost many thousands of dollars of staff-time to find and fix.   And, because the language in question also was “typeless,” there was no compile-time check (in fact, no “compile time” at all ...) which could have found it.

Is the sort of thing that today’s students, schooled as they so-frequently are in strongly-typed tools, could have readily understood and found?   No, because “strong typing,” and the associated powerful compile-time checks, are very much what people expect.

  • Comment on Re^3: Global variable unexpectedly modified when passed by reference

Replies are listed 'Best First'.
Re^4: Global variable unexpectedly modified when passed by reference
by BrowserUk (Pope) on Dec 09, 2014 at 17:54 UTC
    BrowserUK, the very least that you can do, before spewing-off like that, is to have the professional courtesy to do so under your own name, thus to accept responsibility for the downvotes, if not outright post-deletion, that such a thing would so richly deserve.

    I always do. I wasn't me. I'm no longer the only one who has seen you for what you are. Almost the diametric opposite of what you think you are and claim to be.


    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.
Re^4: Global variable unexpectedly modified when passed by reference
by Anonymous Monk on Dec 09, 2014 at 21:36 UTC

    It wasn't BrowserUk.

    this entire reply is vitriolic rubbish

    The first half shows how you directly contradict the Perl documentation.

    I do, however, wish to clarify the technical point.

    You didn't address the above. Or the issue below for that matter.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2019-10-19 17:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?