object_states 2
by Lanas other posts by this author
Nov 20 2006 12:14PM messages near this date
Re: Flushing a FollowTail wheel.
|
Re: object_states 2
Hi again,
Is there a way to choose the obj as well as the method ? The example
below will call method2() of whatever object was declared last in the
object_states list (or so it seems), when several different objects have
same method names:
my $obj_a = osObj1-> new();
my $obj_b = osObj2-> new();
POE::Session-> create
(
object_states =>
[
$obj_a => ['method1', 'method2'],
$obj_b => ['method1', 'method2'],
],
inline_states =>
{
_start => \&startIt,
},
);
sub startIt
{
print "Started !\n";
$_[KERNEL]-> alias_set("os");
$_[KERNEL]-> post('os', 'method2');
}
method2() of obj_b gets called. How to specify obj_a ?
Cheers,
Al
Thread:
Lanas
Matt Sickler
Tavin Cole
|