Seems to me that you want to pass a scalar reference:
my $test = "foo bar"; print "Test is now: $test \n"; test(\$test); print "Test is now: $test \n"; sub test { my ( $ref ) = @_; $$ref =~ s/foo/whatever/g; }
In reply to Re: Way to do a "scalar ref"?
by egga
in thread Way to do a "scalar ref"?
by ultranerds
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |