ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-poe
perl-poe
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved