in reply to Process output redirecting

A few simple steps:

  1. At the top of your program, open LOGFILE, ">somefilename.log" or die "Can't write logfile: $!";
  2. After that, select LOGFILE; to make all of your prints go to LOGFILE instead of STDOUT
  3. At the bottom of the program, don't forget to close LOGFILE or die "Can't close logfile: $!";

Look up open, select, and close for some more details.

 
perl -e 'print "I love $^X$\"$]!$/"#$&V"+@( NO CARRIER'