- or download this
#!/usr/bin/env perl
use warnings;
...
system 'print_to_3.pl';
print $fh "This is to fd $ENV{myfd} from the parent\n";
- or download this
#!/usr/bin/env perl
use warnings;
...
print "Child opened FD $ENV{myfd}\n";
my $p=print OUT "***\nHere is data going to fd $ENV{myfd}\n***\n";
warn "return value of print=$p ($!)\n";
- or download this
#!perl -w
use strict;
...
system 'print_to_3.pl';
print $fh "This is to fd $ENV{myfd} from the parent\n";
- or download this
open OUT,">&=$ENV{myfd}" or die "cannot dup $ENV{myfd}: $!\n";
print "Opened FD $ENV{myfd}\n";
$x=print OUT "***\nHere is data to FD $ENV{myfd}\n***\n";
warn "print=$x ($!)\n";