- or download this
# Open log file once
open(MYFILE, '>>', $qfn)
...
...
print_to($to_file ? *MYFILE : *STDOUT, $str);
- or download this
open(my $MYFILE, '>>', $qfn)
or die("Cannot open file $qfn for appending: $!\n");
...
...
print_to($to_file ? $MYFILE : *STDOUT, $str);
- or download this
my $MYFILE;
if ($to_file) {
...
}
print_to($MYFILE, $str);