open(STDOUT, '> myfilename.txt'); #reopen STDOUT as a file print "This goes to the file\n";
open(OUTFILE, '> myfilename.txt'); print "This goes to the screen\n"; open(STDOUT, '>&OUTFILE'); #dup STDOUT to OUTFILE print "This goes to the file\n";
In reply to Re: Re: STDOUT redirect in Perl
by Ven'Tatsu
in thread STDOUT redirect in Perl
by jay469
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |