Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Pass array, then clear

by AnomalousMonk (Archbishop)
on Jan 15, 2018 at 23:34 UTC ( [id://1207325]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Pass array, then clear
in thread Pass array, then clear

Do you think this is intuitive behavior ...? I'm concerned that this behavior deserves an explanation somewhere.

No, it's not intuitive; however, this is pretty much the way references work in any computer language. Maybe see reference, perlref, perlreftut. Perhaps also take a look at the Monastery Tutorials articles in References, and maybe also at Coping with Scoping and other articles in Variables and Scoping.

(And yes, you need to adjust your thinking :) (Update: And yes, references and aliasing have bitten me, too — many times, many, many times...)


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-20 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found