Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Perl migration hp-ux -> Linux ( perlport, File::Spec->devnull )

by Anonymous Monk
on Aug 14, 2015 at 09:29 UTC ( [id://1138549]=note: print w/replies, xml ) Need Help??


in reply to Perl migration hp-ux -> Linux

See perlport, use File::Spec->devnull
  • Comment on Re: Perl migration hp-ux -> Linux ( perlport, File::Spec->devnull )

Replies are listed 'Best First'.
Re^2: Perl migration hp-ux -> Linux ( perlport, File::Spec->devnull )
by vccs (Initiate) on Aug 14, 2015 at 11:03 UTC
    I changed the code to
    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;
    and it works. Is it because the /dev/null behaviour is different on HP-UX and LINUX?
      Another contributory factor might be that you are opening STDIN for output instead of input i.e. more normal would be:
      open STDIN, '/dev/null' || die "Can't read /dev/null: $!";

      One world, one people

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1138549]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-25 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found