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"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://927911]
help
Chatterbox?
and all is quiet...

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













    Results (328 votes). Check out past polls.

    Notices?