Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Way to do a "scalar ref"?

by ikegami (Pope)
on Sep 26, 2011 at 17:54 UTC ( #927911=note: print w/ replies, xml ) Need Help??


in reply to Way to do a "scalar ref"?

\@test_array and \%test_hash becomes \$test_scalar

@$array_ref and %$hash_ref becomes $$scalar_ref

So,

my $test_scalar = 123; print Dumper($test_scalar); test_hash(\$test_scalar); print Dumper($test_scalar); sub test_scalar { my $scalar_ref = $_[0]; $$scalar_ref = "whatever"; }


Comment on Re: Way to do a "scalar ref"?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://927911]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2014-10-26 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (151 votes), past polls