in reply to Re: Re: Daemon sub refuses to daemonize. Why?
in thread Daemon sub refuses to daemonize. Why?

If this were my code, I would probably not write it this way to begin with. Instead, I would assign the reference returned by IO::File->new to a scalar then check to make sure it's defined.

Something like:

my $fh = IO::File->new($file, O_WRONLY|O_CREAT|O_EXCL,0644); die "Can't create $file: $!\n" unless defined $fh; return $fh;
Instead of:
return IO::File->new($file, O_WRONLY|O_CREAT|O_EXCL,0644) or die "Can't create $file: $!\n";