http://www.perlmonks.org?node_id=1037512


in reply to save output of program in another file

print to outfile.txt:

open $MYFILE, '>', "outfile.txt"; print $MYFILE "blah blah blah"; ### don't put "," after $MYFILE close $MYFILE;

what do i do in the command line?

i.e. in bash, you make a pipe with ">"

perl thisismygreatperlscript.pl > everythingwasfine-im-the-output.txt 2>somethingwaswrong-im-the-log.log