in reply to Re^6: Split output by tabs
in thread Split output by tabs
The ambiguity comes between printing to a filehandle and printing a variable to STDOUT. i.e.:
That ambiguity is not solved by a "Best Practice", since it persists; the so-called "Best Practice" obscures knowledge and doesn't catch all type of errors.
$f = "foo"; # (1) # ... # time passes... (2) # ... print {$f} bar; # (3)
Here, the poor practice is, in the first place, using a meaningless single letter as a variable identifier. Second, to allow for actions at a distance using that variable. Third, not checking for the success of print which a) goes to a symbolic bareword filehandle reference (bad!) and b) most likely to a closed file handle.
These are the real problems here, and not the use or omission of curlies around every file handle expression.
And, again: it is better to know about ambiguities and how to handle them, instead of adhering to a "Best Practice" in a futile attempt to avoid them.
Think language.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Split output by tabs (bogus best practice)
by ColonelPanic (Friar) on Nov 13, 2012 at 15:36 UTC | |
by shmem (Chancellor) on Nov 13, 2012 at 16:03 UTC | |
by tye (Sage) on Nov 13, 2012 at 17:04 UTC | |
by shmem (Chancellor) on Nov 13, 2012 at 20:21 UTC |