D
Dilbert
I have a first perl-program ("first.pl") that calls a second perl-
program ("second.pl") and captures STDOUT and STDERR.
Is there a way inside "second.pl" to magically open a filehandle to
the terminal, even though STDOUT and STDERR are both redirected ?
I'm working under Ubuntu Linux.
first.pl
======
use strict;
use warnings;
system 'perl second.pl >file1.txt 2>file2.txt';
second.pl
======
use strict;
use warnings;
print STDOUT "This is STDOUT\n";
print STDERR "This is STDERR\n";
open my $fh, '>', ??magic-terminal?? or die "Error: Can't open magic
terminal because $!";
print {$fh} "This is magically going to terminal\n";
close $fh;
program ("second.pl") and captures STDOUT and STDERR.
Is there a way inside "second.pl" to magically open a filehandle to
the terminal, even though STDOUT and STDERR are both redirected ?
I'm working under Ubuntu Linux.
first.pl
======
use strict;
use warnings;
system 'perl second.pl >file1.txt 2>file2.txt';
second.pl
======
use strict;
use warnings;
print STDOUT "This is STDOUT\n";
print STDERR "This is STDERR\n";
open my $fh, '>', ??magic-terminal?? or die "Error: Can't open magic
terminal because $!";
print {$fh} "This is magically going to terminal\n";
close $fh;