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