http://www.perlmonks.org?node_id=1003633


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.