use strict; use warnings; use MCE::Loop; use Data::Dumper; my %hash; our %hash2; our $counter1=0; our $counter2=0; open (my $fh, "<", "DATA_F") or die($!); print "printing counter1\n"; while(<$fh>){ my ($k, $v)=split; $hash{$k}=$v; print $counter1++,$/; } print "done printing counter1\n"; print "printing counter2\n"; MCE::Loop::init { use_slurpio => 1, max_workers => 16, init_relay=>0 }; mce_loop_f{ my ($mce, $file, $id)=@_; open (my $ifh, "<", $file) or die("$!"); while(<$ifh>){ my ($k, $v)=split; $hash2{$k}=$v; print $counter2++,$/; } } $fh; print "done printing counter2\n"; print $counter1, "=counter1 final\n"; print $counter2,"=counter2 final\n"; print Dumper(\%hash); print Dumper(\%hash2); #### printing counter1 0 1 2 done printing counter1 printing counter2 0 1 2 done printing counter2 3=counter1 final 0=counter2 final #How can I get MCE to make $counter2 available to print()? $VAR1 = { '2' => 'two', '1' => 'one', '3' => 'three' }; $VAR1 = {}; #How can I get MCE to make %hash2 available to Dumper()?