Nagios::Plugin::DieNicely 0.05

Posted on 03/06/

Got the tests for Nagios::Plugin::DieNicely working on all platforms unless Windows...

Nothing really wrong with the module. The strangeness with the exit codes was about how die works.

Die doesn't imply a fixed exit code. It will exit perl with the value of $! (last system error code) if it's non-zero. The it the exit code will be ($? >> 8) (last exit code of commands that return there) if it's non-zero. Finally (if $! AND $? are non-zero) the exit code will be 255

And why was I so surpised? Because what was happening is that $! has a value of 9 on lot's on some platforms just after perls' initialization (in a BEGIN block), probably because some system call will put a 9 in $!.