note
karlgoethebier
<blockquote><i>"...2 sub's parallel in perl"</i></blockquote>
<p>Consider something like this totally useless little sketch:</p>
<c>
#!/usr/bin/env perl
use strict;
use warnings;
use threads;
use MCE::Hobo;
use Data::Dump;
use feature qw(say);
use constant AMOUNT => 0;
my $shared = MCE::Shared->hash();
my $nose = MCE::Hobo->new( \&nose, "cuke" );
my $foo = MCE::Hobo->new( \&foo, "bar" );
# $nose->join;
# $foo->join;
MCE::Hobo->wait_all();
my $hash_ref = $shared->export;
dd $hash_ref;
say $shared->{nose};
say $shared->{foo};
sub nose {
sleep AMOUNT;
$shared->set( nose => shift );
}
sub foo {
sleep AMOUNT;
$shared->set( foo => shift );
}
__END__
</c>
<p>Best regards, Karl</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-1001958">
<p>«The Crux of the Biscuit is the Apostrophe»</p>
<p><c>perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'</c>[href://?node_id=1001958#env|Help]</p>
</div></div>
1206525
1206525