I have a piece of code
#! /usr/local/bin/perl
use Oraperl;
use DBI;
use FileHandle;
use rf;
use IO::Socket;
use IO::Handle;;
use POSIX qw(setsid);
die "syntax: $0 port" if 1 > @ARGV;
$port=$ARGV[0];
open STDIN, '>/dev/null' or die "Can't read /dev/null: $!";
print "Step 1\n";
open STDOUT, '>','/dev/null' or die "Can't write to $prout: $!";
print "Step 2\n";
open STDERR, '>/dev/null' or die "Can't write to $prerr: $!";
...
This piece of code works fine on HP-UX
with version:# perl -v
This is perl, v5.8.3 built for IA64.ARCHREV_0-thread-multi-LP64
But now that we are migrating to Linux (RedHat 6.6), the code fails on the command:
open STDOUT, '>','/dev/null' or die "Can't write to $prout: $!";
putting this line into comment, then it works.
Perl version on LINUX: perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
Any ideas what is causing this?