Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: difference between pointer and referrence in perl

by bv (Friar)
on Aug 26, 2009 at 21:07 UTC ( #791459=note: print w/replies, xml ) Need Help??


in reply to difference between pointer and referrence in perl

For the most part, they act the same. Probably the biggest difference I have noticed is that you don't have to worry about dereferencing a reference after the object referred to goes out of scope:

my $ref; { my $var = 5; $ref = \$var; } # prints 5 print $$ref;
$,=' ';$\=',';$_=[qw,Just another Perl hacker,];print@$_;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2021-06-16 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (74 votes). Check out past polls.

    Notices?