I agree in spirit but disagree on some of the details. The main thing that should not be done is having a package name that doesn't contain "::".

I'd rather have a subroutine named "Bar" than one named "bar". Consider sub Log versus sub log and then doing log("Error at....") and you'll get "Argument isn't numeric" and "Can't take log of 0".

I try to use multi-word subroutine names so that I can avoid conflicts with both poorly named modules and with keywords that have slipped my mind (or got created since I wrote the code, etc.) by using initial lower case and capitals in the middle ("logToFile"). But when I get lazy and use a single-word subroutine name, then I try to remember to capitalize (if you don't, then you need to always call it with a leading ampersand, &log(), to be safe).

Perl has lots of poorly named modules. The worst two are O.pm and B.pm. But CGI.pm and CPAN.pm are also bad names that should be changed. They don't even work well in English because someone says "I'm using CPAN" and I don't know if they are talking about the module or CPAN itself (the Archive Network, ya know, the thing that you'd know I was talking about when I said "CPAN" if it weren't for someone short-sightedly naming a module that).

All modules should have "::" in their name.

                - tye

In reply to Re^2: Capitalized subroutine names and packages (bad package names) by tye
in thread Capitalized subroutine names and packages by elusion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.