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

Re^2: pointer/alias question

by shoness (Friar)
on Dec 03, 2010 at 01:43 UTC ( #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 (Sage) 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
Node Status?
node history
Node Type: note [id://875059]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2020-10-24 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (242 votes). Check out past polls.

    Notices?