Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Way to do a "scalar ref"?

by egga (Monk)
on Sep 26, 2011 at 08:58 UTC ( #927824=note: print w/replies, xml ) Need Help??


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 (Friar) on Sep 26, 2011 at 08:59 UTC
    Hi,

    Wahoo, thats the beauty - thanks!

    Andy

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://927824]
help
Chatterbox?
and nobody stirs...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2017-11-18 01:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (276 votes). Check out past polls.

    Notices?