Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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; }


Comment on Re: Way to do a "scalar ref"?
Download Code
Re^2: Way to do a "scalar ref"?
by ultranerds (Pilgrim) 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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2014-12-26 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (165 votes), past polls