in reply to Is there a problem with using barewords as filehandles ?

Apart from scoping/namespace rules...

The essential problem is that subs and FHs can't be distinguished.

In Perl 4 subs needed a & sigil, this was dropped in Perl 5 but no sigil was introduced for filehandles, so ambiguity was a consequence.

That's not only frustrating for users but must complicate maintenance of the parser.

Another problem is passing FH as arguments into subs.

Then newbies need to learn the whole typeglob technique with *FH.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re: Is there a problem with using barewords as filehandles ?

Replies are listed 'Best First'.
Re^2: Is there a problem with using barewords as filehandles ?
by perlfan (Parson) on Jul 02, 2020 at 05:11 UTC
    >The essential problem is that subs and FHs can't be distinguished.

    This also implies constants defined by constant, which boils down to subroutines.