liuweichuan has asked for the wisdom of the Perl Monks concerning the following question:
then try the $_OBJECT in other pl,package baozi; sub new{ my $class = shift; my $self = bless {}, $class; } sub fun1{ my $self = shift; print "fun1......baozi \n" } 1
I think 'next2' call 'next3' handler, and run sub baozi.$self->baozi::fun1(); can call package baozi's fun1. but I know my thinking is wrong, plz tell me more right, and help me understand $_OBJECT, thank you.use POE; use baozi; POE::Session->create( inline_states => { _start => sub { $_[KERNEL]->yield('next1')}, next1 => sub { print "tick ... \n"; $_[KERNEL]->delay(next2 => 1); }, next2 => \&next2, next3 =>\&baozi, }, ); POE::Kernel->run(); sub next2{ print "tick 0 ... \n"; $_[KERNEL]->yield('next3'); } sub baozi{ my $self = $_[OBJECT]; print $self; $self->baozi::fun1(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $_[OBJECT] 's example
by Anonymous Monk on Jul 28, 2016 at 03:39 UTC |