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

Re: share array of hashes between main program and thread

by bichonfrise74 (Vicar)
on Nov 05, 2009 at 20:55 UTC ( [id://805344]=note: print w/replies, xml ) Need Help??


in reply to share array of hashes between main program and thread

I think you are just missing to return the values after you push your data, this is why you are not getting any data and causing you to get an error. Please see below.
#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my @array; my $new_array = do_something( @array ); print Dumper \$new_array; sub do_something { my ( $Array_ref ) = shift; push( @{ $Array_ref } , { file => 'test1.zip', price => '10.00', desc => 'the 1st test' } ); return $Array_ref; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-19 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found