Clearer for those accustomed to old school Perl and in a very small context maybe.
The preferred convention currently is to use a lexical file handle as shown by wind which is safer than the old school bare word file handle and, with an appropriate name, is at least as clear.
True laziness is hard work
| [reply] |
++ GrandFather; you are, of course, correct... and I should not assert my taste as a fact.
However it seems to me that the current convention has some serious deficiencies unless, as you suggest, the variable has a crystal-clear name or is documented in a comment. Otherwise, it runs the risk of appearing to spring forth from nowhere, whereas the bareword usage has sufficient precedent to avoid any lack of clarity.
For a case that seems plausible to me, suppose wind's lines 6-8 were separated from lines 10-12 by multiple lines of code to process the page content; to limit to the minimum desired what's actually written to file. Alternately (particularly relevant here), consider the possibility that one wished to use inline code (probably not the best technique, but one that's often seen) to deal with encoding (the first few bytes appear to be non-ASCII) or to format the comma-separated-values across tab-spaced columns for printing.
JM$.02W
| [reply] |
| [reply] [d/l] |