in reply to Re: Perl migration hp-ux -> Linux ( perlport, File::Spec->devnull )
in thread Perl migration hp-ux -> Linux
and it works. Is it because the /dev/null behaviour is different on HP-UX and LINUX?use DBI; use FileHandle; use rf; use File::Spec; use IO::Socket; use POSIX qw(setsid); sub get_msg_id_and_type; sub REAP { 1 until (-1 == waitpid(-1, WNOHANG)); $SIG{CHLD} = \&REAP; } $SIG{CHLD} = \&REAP; #$devnull = File::Spec->devnull(); open STDIN, '>/dev/null' || die "Can't read /dev/null: $!"; #open STDOUT, '>/dev/null' || die "Can't write to $prout: $!"; open STDOUT, File::Spec->devnull() || die "Can't write to $prout: $ +!"; open STDERR, '>>/dev/null' || die "Can't write to $prerr: $!"; defined(my $pid = fork) || die "Can't fork: $!"; exit if $pid;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Perl migration hp-ux -> Linux ( perlport, File::Spec->devnull )
by anonymized user 468275 (Curate) on Aug 14, 2015 at 11:27 UTC |