in reply to STDOUT redirect in Perl
Using this way is good if you only have to print one time, instead of using 'select'. It is really not a good idea to change STDOUT, but rather just make a new filehandle like 'OFILE' shown above.open(OFILE, ">test.txt"); # make a filehandle print OFILE "this is a test.\n"; # print to filehandle
|
|---|