> POE::Session->create(
> inline_states => {
> _start => sub {
> $_[KERNEL]->{server}->put(@data);
> $_[KERNEL]->post('do_something_else');
> },
> do_something_else => \&do_something_else,
> },
> );
>
> >
> > $poe_kernel->run();
>
> POE is a programming environment, not just a collection of handy modules
> to abstract tedious work away. Fire up a session which knows how to do
> the work you want it to do.
Thanks Sungo, I understand what you say. I'm trying to write something that
I intend to upload to CPAN but I'm having trouble making it so the end user
doesnt' have to know anything about POE
I added:
POE::Component::Client::TCP->new(
....
ServerInput => \&serverInput,
InlineStates => {
processRecord => \&processRecord,
},
);
sub serverInput {
push @record, $_[ARG0];
$_[KERNEL]->post('processRecord');
}
sub processRecord {
print "In process: ", $record[0], "\n";
}
But nothing happens. If I change "post" to "yield" then I call the
processRecord subroutine is called. Why is that?
Thanks again
Jay