by Damian Conway
ISBN: 0596001738
Buy from O’Reilly
Found in 8 comments on Hacker News
Enk1du · 2025-07-24 · Original thread
I quite enjoyed Perl Best Practices[0] for the rationales behind every decision, most of which I could get on board with. Plus, if you really like it you can auto-reformat code with perltidy[1] using the "--perl-best-practices" flag or check your files with Perl::Critic[2] policies based on PBP.

It's dear to me because it came along at a time when I needed short breaks from thesis writing.

  [0] https://www.oreilly.com/library/view/perl-best-practices/0596001738/   [1] https://metacpan.org/dist/Perl-Tidy/view/bin/perltidy   [2] https://metacpan.org/pod/Perl::Critic

nocman · 2022-05-04 · Original thread
A regex can be difficult to parse, especially if it is very involved, but in Perl at least, there are ways to make it much easier ( using the /x modifier, for example : https://perldoc.perl.org/perlre#%2Fx-and-%2Fxx ). Comments and and having the regex itself be multiline can make things better, especially if you are creating a particularly complicated one.

Damian Conway highly recommends using the combo of 'xms' his Perl Best Practices Book ( https://www.oreilly.com/library/view/perl-best-practices/059... ).

The revised and considerably newer "Modern Perl Best Practices" video series on O'Reilly's learning platform is particularly good also ( https://www.oreilly.com/library/view/modern-perl-best/978149... ) - with lots of discussion of regexes.

programd · 2022-02-16 · Original thread
> Worked as a Perl dev for 15 years and enjoyed it

Similar situation here. Perl is awsome and I'm still bitter that Python won. I mean significant whitespace - what great madness is this???

Anyway, yes, mod_perl ran the Web for about a decade in the early 2000s and I built and maintained huge websites which were all Perl on the back end.

BTW the book "Perl Best Practices" by Damian Conway [0] is the best general programming book I have ever read. Every software engineer should read it no matter what language they program in. So much good advice which applies to pretty much any significant software project. IMHO right up there with the "Mythical Man Month", though obviously much more low level.

[0] https://www.oreilly.com/library/view/perl-best-practices/059...

IlliOnato · 2021-06-18 · Original thread
"Coding in paragraphs" is described in Damian Conway's book "Perl best practices" [1]

Myself I like coding in paragraphs very much, and giving the paragraphs one-liner headings (comments) definitely makes code for me more readable and easier to navigate.

I usually don't give a heading to a "paragraph" which is just one line, unless that line does something subtle. (Conway provides a definition of "subtle": if you need to think more than 10 seconds or consult the fine manual to figure out what the line does).

[1] https://www.oreilly.com/library/view/perl-best-practices/059...

kbenson · 2018-05-23 · Original thread
You can also get a real quick exposure from the Modern::Perl module[1], which is by the author of the book mentioned in a sibling reply.

The basic idea is simple though. Use strict. Use warnings. Use new features and best practices modules (Task::Kensho[2] an help here) when them make sense (e.g. Moose/Moo). Be aware at least what PBP[3] is, and if you feel so inclined, use Perl::Tidy and/or Perl::Critic (even if your own defined subset of rules) to give yourself an idea of what is considered good practices (and when to throw them our for that elegant line or two, just don't forget to comment it so you don't confuse yourself when you see it months/years later). Basically, if you care about the code you write, you should find yourself gravitating towards writing Modern Perl anyway, and the speed at which it happens is largely determined by your exposure to the Perl community at large.

My own personal set of best practices means almost always using something like Function::Parameters or Kavorka, and possibly Moops.[4]

1: https://metacpan.org/pod/Modern::Perl

2: https://metacpan.org/pod/Task::Kensho

3: http://shop.oreilly.com/product/9780596001735.do

4: https://news.ycombinator.com/item?id=11633961

falsedan · 2017-03-24 · Original thread
If I wrote a post, it would be: "read Ch. 12 of Perl Best Practices (2005)[0]".

Yow, $30+ for the ebook! I wouldn't buy if just for that chapter… fortunately, the guidelines from the book have been codified as Perl::Critic, so If you don't mind missing out on the gently guiding text which accompanies each rule, you can browse the Perl::Critic::Policy::RegularExpressions[1] submodule docs.

[0]: http://shop.oreilly.com/product/9780596001735.do [1]: https://metacpan.org/pod/Perl::Critic::Policy::RegularExpres...

justinator · 2015-10-06 · Original thread
Probably soon.

Perl 5 has a Tidy'ing tool[0], as well as a Lint[1] tool. Both are based on rules created from (originally) Best Practices [2]. These rules of course can be modified to taste, so you can set your own rules/filters before checking in your changes to a repo (or, whatever)

[0] https://metacpan.org/pod/distribution/Perl-Tidy/lib/Perl/Tid...

[1] https://metacpan.org/pod/Perl::Critic

[2] http://shop.oreilly.com/product/9780596001735.do

julie1 · 2014-10-06 · Original thread
http://shop.oreilly.com/product/9780596001735.do chapter 7.

Don't focus on the Perl language, just on their best practices for documentation. the guideline in terms of content are totally relevant for any language/developers and polished by practice.

Even if I chose to switch from Perl to python, I still miss Perl in terms of module distribution/testing/documentation.

Perl, and Perl community, I miss you, and I value what you learnt me :)

I advocate for people to be open minded and take good ideas without prejudice on their origins.