Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Is it possible to do pass by reference in Perl

by btrott (Parson)
on Apr 03, 2000 at 23:12 UTC ( [id://6777]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Is it possible to do pass by reference in Perl?

... And, as would follow from chromatic's answer, if you modify the references within a subroutine, you'll also modify the values those references point to, outside the subroutine.
my $str = "foo"; print $str, "\n"; change(\$str); print $str, "\n"; sub change { my $ref = shift; $$ref = "bar"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://6777]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.