loris has asked for the wisdom of the Perl Monks concerning the following question:
I'm sure I should know how to do this: if an output file name is defined, write output to that file, otherwise to STDOUT, i.e.
if ($outfile) { open($out, ">", $outfile); } else { $out = ??? } print $out $text;
What do I need in the else branch?
Thanks, loris
Update: Just fixed typo in title.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Swiching between output to file and STDOUT
by davorg (Chancellor) on Nov 09, 2004 at 13:58 UTC | |
by Fletch (Bishop) on Nov 09, 2004 at 14:16 UTC | |
|
Re: Swiching between output to file and STDOUT
by borisz (Canon) on Nov 09, 2004 at 14:00 UTC | |
|
Re: Swiching between output to file and STDOUT
by thor (Priest) on Nov 09, 2004 at 20:43 UTC | |
by edan (Curate) on Nov 11, 2004 at 10:31 UTC | |
by gaal (Parson) on Nov 11, 2004 at 10:46 UTC | |
|
Re: Swiching between output to file and STDOUT
by saintmike (Vicar) on Nov 09, 2004 at 21:10 UTC |