I am playing with a daemon that forks and am trying to be thorough as this will
hopefully become production code. My daemon uses:
use POSIX qw(:sys_wait_h :errno_h :signal_h);
For some of the fork handling. Later I looked at the fork description from The Camel
(3rd Edition - pg. 715) and then added the following to my fork:
use Errno qw(EAGAIN);
<etc.>
elsif ($! == EAGAIN) {
sleep 5;
redo FILEFORK;
}
When running this code I get:
Prototype mismatch: sub main::EAGAIN vs () at /usr/local/lib/perl5/5.6.1/Exporter.pm
line 57.
Exporter::import('Errno', 'EAGAIN') called at
/export/home/bmiller/rearch/bin/daemon.pl line 26
main::BEGIN() called at /usr/local/lib/perl5/5.6.1/sun4-solaris/Errno.pm line
26
eval {...} called at /usr/local/lib/perl5/5.6.1/sun4-solaris/Errno.pm line 26
Which appears to be a "Severe" warning. (and as you can see I am on solaris with 5.6.1
hopefully moving to 5.8.0 early next year).
I realize that my two use statements are conflicting and that use POSIX qw (:errno_h)
is likely already defining EAGAIN. So my question is do I need to worry about the
warning, do I need to even include the use Errno qw(EAGAIN) since I already have the
use POSIX line in there? Or should I remove the :errno_h from the POSIX string and
get them using Errno? How is this particular instance best handled?
Thanks,
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]