A review of PBP which praises Damian's rationale without quoting it, alas
If you are really keen you might be able to read at least part of the rationale by searching via google books,
I just did that and here is some of Damian's rationale:
... using a bareword as a file handle causes Perl to store the corresponding input stream descriptor in the symbol table of the current package ... and if that symbol has already been used as a filehandle anywhere else in the same package, executing this open statement will close the previous file handle and replace it with the newly opened one ... bareword file handles are even more unreliable if there happens to be a subroutine of the same name currently in scope ...
For completeness, from Perl Best Practices
here are all Perl Best Practices that mention bareword or filehandle:
- 45. Don't use barewords.
- 125. Don't use bareword filehandles.
- 126. Use indirect filehandles.
- 127. If you have to use a package filehandle, localize it first.
- 130. Close filehandles explicitly, and as soon as possible.
- 133. Slurp a filehandle with a do block for purity.
- 136. Always put filehandles in braces within any print statement.
- 246. Don't tie variables or filehandles.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|