|< 1 2 >| | 13 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
use POE qw(Session);
POE::Session->create( 'inline_states' =>
{ '_start' => \&test }, 'args' => [ "hi" ],
);
sub test {
print "hier mal das 'hi' ausgeben";
}
POE::Kernel->run();
1
2
3
4
sub test {
my @args = @_[ARG0..$#_];
print "hier mal das 'hi' ausgeben: $args[0]\n";
}
1
2
3
4
5
6
7
8
_start
_start is a session's initialization event. It tells a session that the Kernel has allocated and initialized resources for it, and it may now start doing things. A session's constructors invokes the _start handler before it returns, so it's possible for some sessions' _start states to run before $poe_kernel->run() is called.
Every session must have a _start handler. Its parameters are slightly different from normal ones.
SENDER contains a reference to the new session's parent. Sessions created before $poe_kernel->run() is called will have KERNEL as their parents.
ARG0..$#_ contain the parameters passed into the Session's constructor. See Session's new() and create() methods for more information on passing parameters to new sessions.
|< 1 2 >| | 13 Einträge, 2 Seiten |