in reply to Re: Re: Re: Re: Re: Re: New warnings Perl 5.8.3 in IO/File
in thread New warnings Perl 5.8.3 in IO/File

The call to open3() opens STDIN for reading in the child process and closes it in the run harness. Adding

# This opens FH0 to prevent File::IOs new 5.8.3 warning FileHandle->new("</dev/null") or die "unable to open /dev/null: $!" # Alternatively, open the next file READ as well as write FileHandle->new("<>$pidFile") or die "unable to open $pidFile: $!"

just after the open3() call prevents File::IO from warning, because FH0 is opened for read.

Ughhh! I will do this for the moment, but this is the first time I can ever recall having to do something unnecessary to suppress a warning. I have, until now always treated warnings as something I NEVER want to do, sigh - IMHO this devalues my 'Absolutely No Warnings' tenet.

Regards,

Jeff

Replies are listed 'Best First'.
Re: Re: New warnings Perl 5.8.3 in IO/File
by ysth (Canon) on Mar 25, 2004 at 11:11 UTC
    I don't think it violates your tenet; leaving STDIN closed is really something you never want to do, and that's just what you are avoiding. However, (without having actually looked at it) I don't think the run harness should be closing STDIN when you pass it like that.

    I don't think "<>" would work. Try "+<" or "+>".

    I would do it as: open STDIN, "</dev/null" or die ... so perl's STDIN looks open as well as file descriptor 0.