in reply to Unix system commands to Perl
open my $fh => $file or die "Failed to open $file: $!\n"; open my $mh => "| mailx -s 'Title' email" or die "Failed to open pipe: + $!\n"; print $mh $_ while <$fh>; close $mh or die "Failed to close pipe: $!\n"; close $fh or die "Failed to close $file: $!\n";
With open STDERR, "/dev/null" you open the handle for reading. Try opening it for writing, using open STDERR, "> /dev/null"
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Unix system commands to Perl
by Anonymous Monk on Jul 09, 2002 at 18:43 UTC |