in reply to Way to do a "scalar ref"?
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; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Way to do a "scalar ref"?
by ultranerds (Hermit) on Sep 26, 2011 at 08:59 UTC |
In Section
Seekers of Perl Wisdom