in reply to Re: Parallel Processing in Perl
in thread Parallel Processing in Perl
But when I execute this program getting the values like:use threads; use Data::Dumper; my $hash1; my $hash2; while(1) { async( \&sub1)->detach; async( \&sub2)->detach; print '$hash1'. Dumper($hash1) ."\n"; print '$hash2'. Dumper($hash2) ."\n"; print "_______________________________\n"; sleep(10); } sub sub1 { my $now = `date "+%Y-%m-%d %H:%M:%S"`; chomp($now); $hash1->{'time'} = $now; } sub sub2 { my $now = `date "+%Y-%m-%d %H:%M:%S"`; chomp($now); $hash2->{'time'} = $now; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Parallel Processing in Perl
by BrowserUk (Patriarch) on Mar 27, 2010 at 19:07 UTC | |
by Anonymous Monk on Mar 29, 2010 at 05:46 UTC | |
by shree (Acolyte) on Mar 29, 2010 at 05:53 UTC |