Something like this ?

package POE::Component::My::ONE

sub spawn {
 my $class=shift;
 POE::Session->create(
package)states => [$class=> [qw(do)]]
heap=> {HASH->{0}->{0},@_}
);
sub do {
 POE::Component::My::TWO->spawn(HASH=>\%{$heap->{HASH}});
}
}

Package ONE - main package, it will create tasks that will use HASH variable in one time, tasks will edit it and it shout be the same for all the tasks.

thank you very much

On Thu, Jun 09, 2005 at 10:38:03AM +0400, Laura wrote:
hi, Philip, thank you for response.

It must be a global hash, in TWO should be the same as ONE

So just do

HEAP => { HASH => $hashref }

on both startups.

It's a *reference*. Two references to the same variable still point to the
same variable.

--
Matt S Trout Website: http://www.shadowcatsystems.co.uk Technical Director E-mail: mst (at) shadowcatsystems.co.uk
Shadowcat Systems Ltd.

---
Professional hosting for everyone - http://www.host.ru

Reply via email to