12

PERL? Perl? perl? What's good style?

I know the answer—I just wanted to make sure the question was out there and questioners were aware that there is a correct form.

raven
  • 18,004
  • 16
  • 81
  • 112
Piers Cawley
  • 686
  • 6
  • 13

8 Answers8

37

The correct casing is "Perl" for the language and "perl" for the executable. Using "PERL" flags you as someone who isn't particularly familiar with the language or community.

See also What's the difference between "perl" and "Perl"? in perlfaq1.

Michael Carman
  • 30,628
  • 10
  • 74
  • 122
  • Actually, I'd suggest definite familiarity with older versions of the language - the name *used* to be written this way in the manual page for perl 4, along with an explanation that it was an acronym for "practical extraction and reporting language" (ref: http://www-cgi.cs.cmu.edu/cgi-bin/perl-man) many of us older users ignore the revisionist complaints that it isn't an acronym and therefore shouldn't be capitalised. – Jules Feb 03 '16 at 16:23
13

Quoting the Perl article on Wikipedia.

The name is normally capitalized (Perl) when referring to the language and uncapitalized (perl) when referring to the interpreter program itself since Unix-like file systems are case-sensitive. Before the release of the first edition of Programming Perl, it was common to refer to the language as perl; Randal L. Schwartz, however, capitalised the language's name in the book to make it stand out better when typeset. The case distinction was subsequently adopted by the community.

Also check the perlfaq about this question.

1800 INFORMATION
  • 131,367
  • 29
  • 160
  • 239
chakrit
  • 61,017
  • 25
  • 133
  • 162
  • Here's the link to perlfaq: http://perldoc.perl.org/perlfaq1.html#What's-the-difference-between-%22perl%22-and-%22Perl%22%3f – chakrit Sep 16 '08 at 13:48
8

Here's the answer from perlfaq1:

What's the difference between "perl" and "Perl"?

One bit. Oh, you weren't talking ASCII? :-) Larry now uses "Perl" to signify the language proper and "perl" the implementation of it, i.e. the current interpreter. Hence Tom's quip that "Nothing but perl can parse Perl." You may or may not choose to follow this usage. For example, parallelism means "awk and perl" and "Python and Perl" look OK, while "awk and Perl" and "Python and perl" do not. But never write "PERL", because perl is not an acronym, apocryphal folklore and post-facto expansions notwithstanding.

brian d foy
  • 129,424
  • 31
  • 207
  • 592
4

Despite a lot of anecdote to the contrary, "PERL" was never really an acronym -- it's a "backronym". The name Perl was chosen first, then some people jokingly applied expansions to it, which caught on.

The PerlMonks community (highly recommended!) taught me the convention, and it's similar to Java's:

  • It's never PERL (or JAVA)
  • When you're talking about the language, it's Perl (or Java)
  • When you're talking about the interpreter itself, it's perl (or java).

That said, it doesn't make a whole hill of beans if you do it "wrong".

Darren Meyer
  • 2,251
  • 1
  • 14
  • 8
  • Actually those conventions were in place long before Perl Monks arrived :-) – Dave Cross Sep 16 '08 at 14:21
  • 3
    You say "it doesn't make a whole hill of beans", but it certainly can. Spelling it as "PERL" pegs you as someone who is not very familiar with Perl. It's a bit of a shibboleth. – Andy Lester Sep 16 '10 at 21:57
3

"The name is normally capitalized (Perl) when referring to the language and uncapitalized (perl) when referring to the interpreter program itself since Unix-like file systems are case-sensitive." From wikipedia at time of posting.

brian d foy
  • 129,424
  • 31
  • 207
  • 592
Marc Gear
  • 2,757
  • 1
  • 20
  • 19
3

While, as has been said, it doesn't make THAT much difference if you get it wrong, some folks do use correct capitalization (or at least, NOT referring to 'PERL' or any of the more sensible backcronyms) as a shibboleth for clue in job ads. :)

Penfold
  • 2,548
  • 16
  • 16
2

Perl

Tom Ritter
  • 99,986
  • 30
  • 138
  • 174
1

perl or Perl is fine.

1077
  • 1,318
  • 1
  • 10
  • 9