Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 37938
Status: resolved
Priority: 0/
Queue: POE

People
Owner: Nobody in particular
Requestors: rdb [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: POE::Kernel->run() in an END{} block dies quietly with error status
IF there are POE Sessions instantiated, and IF those sessions are only kept alive by their aliases, and IF one calls POE::Kernel->run() to quiet the warning, and IF POE::Kernel->run() is called in an END{} block THEN POE will not issue the warning, BUT the script will exit with a non-0 exit status. Test case: perl -wle 'use POE; POE::Session->create(inline_states => {_start => sub {$_[KERNEL]->alias_set("moo")}}); END { POE::Kernel->run }' ; echo $?
Resolved in revision 2449, which will be released with 1.004. Note, however, this paragraph from perlmod: Inside an "END" code block, $? contains the value that the program is going to pass to "exit()". You can modify $? to change the exit value of the program. Beware of changing $? by accident (e.g. by running something via "system"). The fix in revision 2449 was to localize $? within POE::Resource::Signals' waitpid() loop of last resort. However this will not safeguard you from $? changes that happen during more involved programs. POE will strive to do no harm, but it will not save you from yourself.