in reply to Undo a STDOUT redirect
Localise the change to STDOUT. EG:-
{ local *STDOUT; open(STDOUT, "> $LogFile") || die "Failed: $!"; print STDOUT "Blah"; } print "This should appear on the console window again";
However, I do have to ask - why use STDOUT for this as opposed to another filehandle?
Update: Aaarrrggghhh. Beaten to it by BUU. Apologies for the duplicate response.
|
|---|