Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by LanX (Cardinal)
on Jul 01, 2020 at 11:04 UTC ( #11118758=note: print w/replies, xml ) Need Help??


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 (Priest) 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11118758]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2020-08-10 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (58 votes). Check out past polls.

    Notices?