go ahead... be a heretic | |
PerlMonks |
Re^5: Code style questionby kcott (Archbishop) |
on May 22, 2021 at 11:24 UTC ( [id://11132881]=note: print w/replies, xml ) | Need Help?? |
If you omit the filehandle argument in print, it will default to the last selected filehandle. Unless you change it, you can expect the current filehandle to be STDOUT. In most cases, print @list and print STDOUT @list mean exactly the same thing; the STDOUT is typically omitted. You probably won't need to do it very often; however, if you do change the filehandle (with select) you should keep track of the old filehandle, as you'll often need to restore it. Here's a short script, with output file contents, to demonstrate:
— Ken
In Section
Seekers of Perl Wisdom
|
|