N
nickelstat
But using a file handle.
This works:
open(FH, ">>$file");
close STDOUT;
open STDOUT, ">&FH"; # stdout = dup()
print "this goes to the file\n";
This does NOT work, using a file handle variable
my $fh = new FileHandle;
open($fh, ">>$file");
close STDOUT;
open STDOUT, ">&$fh"; # stdout = dup()
print "this does not go anywhere\n";
How can I make the code with the filehandle variable work?
tia
This works:
open(FH, ">>$file");
close STDOUT;
open STDOUT, ">&FH"; # stdout = dup()
print "this goes to the file\n";
This does NOT work, using a file handle variable
my $fh = new FileHandle;
open($fh, ">>$file");
close STDOUT;
open STDOUT, ">&$fh"; # stdout = dup()
print "this does not go anywhere\n";
How can I make the code with the filehandle variable work?
tia