in reply to how do i redirect STDOUT, STDIN, or STDERR to a FILE?

final self answer ... it works now
if ($opt_f eq '') { print "Please enter the OUTPUT filename [defaults to scre +en]: "; $output_filename = <STDIN>; chomp($output_filename); if ($output_filename eq '') { } else { # open(SAVOUT, ">&STDOUT"); # save the stdout fhan +dle open(STDOUT,">" . $output_filename); select(STDOUT); # force a flush on stdout so tha +t any output will be in sync. $| = 1; } } elsif ($opt_f ne "DEFAULT") { $output_filename = $opt_f; #open(SAVOUT, ">&STDOUT"); # save the stdout fhandle open(STDOUT,">" . $output_filename); select(STDOUT); # force a flush on stdout so that any ou +tput will be in sync. $| = 1; }
maybe someone else will get some mileage out of this i know i use perlmonks as a reference all the time <g>

Originally posted as a Categorized Answer.