Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: pointer/alias question

by shoness (Friar)
on Dec 03, 2010 at 01:43 UTC ( [id://875059]=note: print w/replies, xml ) Need Help??


in reply to Re: pointer/alias question
in thread pointer/alias question

Thanks grandfather!

Got it. Simple. That'll save me quite a few lines. That's the solution for me.

I'm sure I tried something similar, but without the ||{} it was getting an undef reference, which obviously doesn't work.

Anonymous Monk suggests that my use of local was killing my pointer idea it seems.

Out of curiosity, since I looked all over the Perl docs perlsyn, perlvar, etc. Where is the *pointer-thing documented?

Cheers!

Replies are listed 'Best First'.
Re^3: pointer/alias question
by GrandFather (Saint) on Dec 03, 2010 at 02:53 UTC

    toolic gave the link, but the confusion is that it isn't a "pointer thing", it's a "type glob thing". Perl doesn't have pointers. It has references, but that's not the same thing - really, it's not the same thing! Perl uses reference counted memory management and that just doesn't work well with pointers. It does work well with generally not having to worry about how memory is handled though.

    True laziness is hard work
      Thanks again toolic and grandfather. Now that I know what to call it, I see only 28 PerlMonks nodes in more than 10 years that discuss them.

      The docs toolic point to say typeglobs "used to be the preferred way to pass arrays and hashes by reference into a function, but now that we have real references, this is seldom needed".

      Done and done.

      Ovid explains typeglobs well here: Re: Confused about typeglobs and references.

Re^3: pointer/alias question
by toolic (Bishop) on Dec 03, 2010 at 01:52 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (1)
As of 2024-04-18 23:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found