Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: passing arguments as reference

by lidden (Curate)
on Apr 14, 2006 at 10:52 UTC ( [id://543312] : note . print w/replies, xml ) Need Help??


in reply to passing arguments as reference

It is possible.
use strict; use warnings; sub foo{ my $a = 1; print "$a\n"; bar(\$a); print "$a\n"; } sub bar{ my $b = shift; $$b = 2; } foo;

Replies are listed 'Best First'.
Re^2: passing arguments as reference
by davidrw (Prior) on Apr 14, 2006 at 11:01 UTC
    Avoid using $a and $b as sample variables because of their use as package global variables by sort