Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Modifying an object in a fork

by karlgoethebier (Abbot)
on Mar 12, 2018 at 11:15 UTC ( [id://1210702]=note: print w/replies, xml ) Need Help??


in reply to Modifying an object in a fork

Dr Wisenheimer's lightweight edition:

#!/usr/bin/env perl use strict; use warnings; use feature qw(say); use MCE::Shared; package MyClass { use Class::Tiny { foo => q(bar) }; }; my $object = MCE::Shared->share( { module => 'MyClass' } ); say q(Before forking: ) . $object->foo; my $pid = fork; if ( $pid == 0 ) { $object->foo(q(baz)); exit; } else { waitpid $pid, 0; } say q(After forking: ) . $object->foo; __END__

I don't know if this helps. At least it is funny.

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-20 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found