My main problem in getting to use
POE was the documentation. I found it hard to find good documentation on the key concepts and how exactly to get to several POE-related arguments from within functions (it's non-standard way of passing arguments took me a little to get used to). In the end documentation is there, but IMHO hard to find and scattered all over the place (yes, I've read basically everything on the poe website, and perldoc).
This gets me thinking about a little overlay-layer for POE so you can get to HEAP, KERNEL through a hashref like:
sub blabla {
my ($poe_args) = shift;
$poe_args->{KERNEL}->yield("bla");
delete $poe_args->{HEAP}->job;
}
And the use of ARG0, ARG1 ... to pass variables is a little weird to me. For instance an ErrorEvent handler receives 5 parameters that way (ARG0 to ARG4), from the manpage:
...
as follows: ARG0 = the return value of syscall(), ARG1 = errno() -
the numeric value of the error generated, ARG2 = error() - a
descriptive for the given error, ARG3 = the wheel id, and ARG4 =
the handle on which the error occurred (stdout, stderr, etc.)
whereas IMHO it would be more descriptive to have a hash with descriptive names, so you could do:
sub errorhandler {
my ($poe_args) = shift;
if ($poe_args->{ERRNO} == 2) {
print $poe_args->{ERROR};
};
}
that way I didn't have to go to the manpage every time to see what ARG\d I'd need.
That being said, I still think POE is a great set of modules that I liked using, and will use more in the future.