Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: why don't filehandles have punctuation before their name?

by sierrathedog04 (Hermit)
on Apr 24, 2001 at 05:52 UTC ( [id://74928]=note: print w/replies, xml ) Need Help??


in reply to Re: why don't filehandles have punctuation before their name?
in thread why don't filehandles have punctuation before their name?

Filehandles are uppercased so that the introduction of new perl keywords (which are always lowercased) do not break existing Perl scripts. Larry has endorsed this convention.

It seems to me, however, that new keywords could still break existing scripts if those scripts included subroutines with the same names as the keywords. So to be consistent we ought to name our subroutines in all uppercase as well, or at least throw in a few uppercase letters in our subroutine names.

  • Comment on Re: Re: why don't filehandles have punctuation before their name?

Replies are listed 'Best First'.
(tye)Re: why don't filehandles have punctuation before their name?
by tye (Sage) on Apr 24, 2001 at 05:57 UTC

    Perhaps you didn't notice the addition of BEGIN, END, CHECK, DESTROY, and INIT, etc. (: In fact, I think you should name subroutines with mixed case and should avoid the bareword-as-filehandle syntax. The bareword-as-filehandle syntax caused lots of problem even way back in Perl4. It is nice to have an alternative to it in Perl5.

            - tye (but my friends call me "Tye")
      99 percent of the code I see posted here uses barewords as filehandles. Is there some other way to do it? How?
Re: Re: Re: why don't filehandles have punctuation before their name?
by Anonymous Monk on Apr 24, 2001 at 06:14 UTC
    So to be consistent we ought to name our subroutines in all uppercase as well, or at least throw in a few uppercase letters in our subroutine names.
    I prefer to include at least one _. As far as I know, no built-in functions contain underscores, and probably never will.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-19 03:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found