Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Way to do a "scalar ref"?

by johngg (Abbot)
on Sep 26, 2011 at 09:13 UTC ( #927830=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Way to do a "scalar ref"?
in thread Way to do a "scalar ref"?

You seem to have two process_article subroutines, should we assume the second ought to be called process_article_contents? Perhaps you could pass a reference to the hash value, something like this.

knoppix@Microknoppix:~$ perl -MData::Dumper -E ' > sub double { $rsVal = shift; $$rsVal *= 2 } > > $rhData = { one => 1, two => 2 }; > say Data::Dumper->Dumpxs( [ $rhData ], [ qw{ rhData } ] ); > > double( \ $rhData->{ two } ); > say Data::Dumper->Dumpxs( [ $rhData ], [ qw{ rhData } ] );' $rhData = { 'one' => 1, 'two' => 2 }; $rhData = { 'one' => 1, 'two' => 4 }; knoppix@Microknoppix:~$

I hope this is helpful.

Cheers,

JohnGG


Comment on Re^3: 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://927830]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (13)
As of 2015-07-30 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls