|
|
| Perl-Sensitive Sunglasses | |
| PerlMonks |
Re^6: Split output by tabsby ColonelPanic (Friar) |
| on Nov 13, 2012 at 14:13 UTC ( #1003619=note: print w/ replies, xml ) | Need Help?? |
|
I do understand the syntax of Perl filehandles. The ambiguity comes between printing to a filehandle and printing a variable to STDOUT. i.e.:
These two similar looking print statements do something very different. It is not a big deal in this case, but when you replace 'foo' with an expression it can be hard to tell whether $f is a filehandle or a variable. In fact, sometimes even the interpreter can't tell, as the documentation you linked to points out: (NOTE: If FILEHANDLE is a variable and the next token is a term, it may be misinterpreted as an operator unless you interpose a + or put parentheses around the arguments.) Here is a simple example that the compiler can't correctly handle without braces:
When's the last time you used duct tape on a duct? --Larry Wall
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||