M
Modern Perl Blog
modernperlbooks.com · Personal blog · on HN since 2009
chromatic writes about Perl, and hosts the free online Modern Perl book along with posts on the language and its community.
What HN saysCommenters call the Modern Perl book great and brilliant for explaining readable Perl 5 to modern readers, and recommend reading it free or buying it.
103HN people shared it
58linked it in comments
108stories submitted
2.0Kstory points
6 months agolast shared
2009people per year2026
Most-shared posts
- 1Homepage16 people · first shared 2009
- 2Index7 people · first shared 2017
- 3Modern perl 20166 people · first shared 2017
- 4Goodnight, Parrot4 people · 28 points · first shared 2013 · 4 comments on HN
- 5Modern Perl book now on a website4 people · 4 points · first shared 2012 · discussion on HN
- 6Modern perl 20144 people · first shared 2014
- 7Index4 people · first shared 2010
- 8The Mid-Career Crisis of the Perl Programmer3 people · 447 points · first shared 2014 · 167 comments on HN
- 9Modern Perl: The Book: The Draft3 people · 46 points · first shared 2010 · 9 comments on HN
- 10An Accurate Comparison of Perl 5 and Rakudo Star3 people · 36 points · first shared 2010 · 4 comments on HN
- 11Modern Perl, the book, is Available.2 people · 111 points · first shared 2010 · 15 comments on HN
- 12Why I Use Perl: Testing2 people · 65 points · first shared 2012 · 21 comments on HN
- 13How to Learn Perl2 people · 15 points · first shared 2011 · 19 comments on HN
- 14Perl Roles Versus Inheritance2 people · 5 points · first shared 2009 · discussion on HN
- 15Why Perl 5.11.0 Matters2 people · 4 points · first shared 2009 · discussion on HN
What HN people wrote when they linked it
HeckFeck · 2022-09-08
The Modern Perl book is great, it explains a lot of the Perl-isms to a modern audience.
http://modernperlbooks.com/ is where you can read it for free.
hercynium · 2019-11-13
Buy here or read online for free. This is the official website of the book: http://modernperlbooks.com/ (hint - it's worth buying :)
npongratz · 2019-07-11
I found Modern Perl [0] to be an absolutely brilliant exposition of readable Perl 5 and how great Perl can be. I'll be forever grateful to chromatic for writing and revising the book!
[0] http://modernperlbooks.com/
b2gills · 2015-02-05
You may be able to get them to update to at least 5.18.0 if you tell them about CVE 2013-1667 and all the mitigations added to 5.18.0 to prevent them.
https://duckduckgo.com/?q=CVE+2013-1667&ia=about
http://blog.booking.com/hardening-perls-hash-function.html
I would also recommend reading "Modern Perl" which is made available for free by the publisher/author at http://modernperlbooks.com/
( Also there are large codebases written in Perl ( I beleive booking.com is an example )
I also recommend installing the Perl you are using outside of the system directories. You may also find Pinto and https://Stratopan.com useful for managing your dependancies. Which is especially useful if you make your codebase modular.
kbenson · 2015-02-01
Have you been checking it out at all again, or are you considering it? It's been my secret hope for a long time that you would get involved again, if not at the compiler level then at the community and ecosystem level. Your blog[1] was always insightful and a good read, and I think the community is worse without it being active. I'm talking about Perl 6 here, but I could say the same for Perl 5 and it would be at least as true.
1: http://modernperlbooks.com/
draegtun · 2009-03-18
Well Perl5 isn't disappearing because Perl6 is coming around the corner.... in fact the opposite there are lots of cools things happening right now in Perl5 world (see Moose, MooseX::Declare, etc).
So perhaps you should upgrade your Camel book or look at "Perl Best Practices" by Damian Conway. Also keep an eye on http://www.modernperlbooks.com
As for Perl6/Rakudo... no need to wait its already here! Clearly its still "beta" but that shouldn't stop you downloading and playing with it.
chuckadams · 2025-11-20
Also to be fair, a modern Perl app doesn't even need to use `$|++` since the framework, even if it's raw Plack, will manage output flushing for you since you're no longer banging on raw stdout. I'd say Perl suffers from an even worse problem of legacy tutorials than PHP, but the size of PHP's userbase and thus sheer number of bad tutorials makes it worse there.
chromatic's https://modernperlbooks.com site is nearly unmaintained now, but still contains some good links to tutorials and whatnot on the obvious subject. Including a pretty recent retrospective: https://outspeaking.com/words-of-technology/why-perl-didnt-win.html
nocman · 2024-07-06
Generally I hear that in reference to chromatic's book / blog posts:
http://modernperlbooks.com/
cestith · 2022-05-04
I actually received a free book from O'Reilly once for pointing out the exact site you mentioned, so their lawyers could address it.
If you want these books very cheaply, the Perl CD Bookshelf usually sells for about $5 used. You get Perl in a Nutshell in print and a bunch of the other books on CD.
A better introduction to Perl these days is Modern Perl, which is available to read online for free or you can pay for a print book. http://modernperlbooks.com/
citrin_ru · 2021-12-18
http://modernperlbooks.com/ is a good introduction to the language
nchelluri · 2020-06-24
I think you can learn most/all of Perl 5.32 with http://modernperlbooks.com/books/modern_perl_2016/ , and it appears this is, initially, going to be 5.32 with some saner defaults. So you could really start now, given that.
> This beloved guide is now completely updated for Perl 5.22.
I've been working with Perl since about 5.20 and am on 5.31 or 5.32 and haven't noticed many breaking changes FWIW.
mfontani · 2020-05-30
I would strongly recommend you do learn Perl 5 (and Raku, and Haskell, and lua, and functional languages, and ...), even if only to be able to know enough about them to be enlightened about what each of them gets right and wrong.
For Perl 5, you could do worse than going through the _free_ "Modern Perl" book, at http://modernperlbooks.com/books/modern_perl_2016/
richardkmichael · 2018-09-19
I'd recommend "Modern Perl" as well. It's online as HTML or a free PDF, start here: http://modernperlbooks.com/books/modern_perl_2016/
jsymolon · 2018-07-11
> ... not a write-only operation (Perl excepted).
Really need to squash the Perl is write-only. Modern Perl is quite readable, supported by tests and linters.
http://modernperlbooks.com/
singingfish · 2017-08-17
a perl book. (and yes, modern perl[1] is still a good, viable candidate for up-to-date-best-practices development. the only downside is it takes a certain amount of discipline to get it right. The other possible downside is that perl is currently not trendy, on the other hand it's proven to be a very good performer in the long game).
[1] http://modernperlbooks.com/books/modern_perl_2016/ - not my book, mine was more specialised, and I'm not going to transparently disclose my identity here :).
cygx · 2015-12-01
I'm confused why they are so doom and gloom over this amazing new language (Perl 6) that is nearly a stable release.
Cf various rants by chromatic, eg http://www.modernperlbooks.com/mt/2013/02/goodnight-parrot.html
eCa · 2015-10-07
The Modern Perl book[1] is highly recommended.
For web development, check out Mojolicious[2] or Dancer2[3]
And Task::Kensho[4] lists recommended modules for various tasks.
[1] http://modernperlbooks.com/books/modern_perl_2014/
[2] https://metacpan.org/release/Mojolicious
[3] https://metacpan.org/release/Dancer2
[4] https://metacpan.org/pod/Task::Kensho
justinator · 2015-09-29
I think there's a difference between "baby talk" and using Perl as Perl.
You can write Perl that looks like Python, or C, or whatever, but you're missing out on what makes Perl, Perl.
"baby talk" Perl is another name for being able to much with Perl, knowing very little of it. Also known as, "Getting your job done".
It's up to the individual to learn more about the language, which can be done gradually, much like a natural language.
"Clean, maintainable code" in Perl is actually known as, "Modern Perl" [0]
[0] http://modernperlbooks.com/
chromatic · 2014-12-31
I wrote a brief introduction to Perl from philosophy to pragmatic efficacy. It's available free online:
http://modernperlbooks.com/books/modern_perl_2014/
It works best with at least six months practical experience in any programming language.
muraiki · 2014-07-28
If you haven't played with Perl lately, it's worth looking into Moose, an object system for Perl. It not only offers a much nicer syntax for making objects, but provides features like read-only accessors, roles, introspection, and even types! http://search.cpan.org/dist/Moose/lib/Moose/Manual.pod
I work with Perl professionally now after having spent most of my self-taught programming education using Python, and I've been pleasantly surprised with the language. I'm both coding new projects and working with a more than decade old code base, and I've found that Perl code is as good as the programmer.
Yes, like any decades old language it has its warts, but Perl 5 itself is still being developed and improved upon. For those who know another scripting language, the free book Modern Perl is a great place to start learning: http://modernperlbooks.com/books/modern_perl_2014/
untothebreach · 2013-12-19
I also think that things like Modern Perl[1] are helping to move the community away from the "line-noise" style of Perl that it was (in)famous for back in the day.
1: http://modernperlbooks.com
dwoldrich · 2012-06-25
There's also the Modern Perl Books blog which delights in rooting around the guts of modern perl (and modern perl debates) -- http://www.modernperlbooks.com/ :)
AbyCodes · 2011-10-17
There are similar questions in reddit faq: http://www.reddit.com/r/programming/faq#Whatprogrammingblogsorwebsites…
Steve Yegge's archives, http://www.modernperlbooks.com/mt/
are in my favourites, which are not mentioned here so far.
sigzero · 2010-09-03
Read the following and stop asking:
http://www.modernperlbooks.com/mt/index.html
daotoad · 2019-08-30
Perl5 has linters (Perl::Critic, Perl::Lint). And warnings to keep you from using ugly features (if you assert compatibility with the 2010 release 5.12, strict mode is automatically turned on).
JavaScript actually copied its `‘use strict’` syntax from Perl's `use strict;` which in Perl is using a pragma, not a magical string literal that reconfigures the compiler.
You want types? Several systems exist, but the leading implementation is Type::Tiny.
A big part of Perl culture in the late 2000s and early 2010s was focused around rooting out horrible old practices and tutorials, defining good practices, and getting tooling to help. Perl Best Practices came out of in 2005. Some effort to describe these tools and techniques as “modern Perl” followed—check out the inaugural entry of the Modern Perl Books blog from 2009. http://www.modernperlbooks.com/mt/2009/01/
Since Perl5 did what you’re asking for, maybe you should check it out and see what Perl 5 looks like in 2019.
krylon · 2015-11-30
Basically, I guess, I would like something like the Camel book for Perl 6.
There was one published by O'Reilly about ten years ago, but of course back then you could not say "apt-get install perl6" or something equivalent. Also, the language definition was far from finished, back then, so that book is probably totally outdated by now.
The Perl community, as far as I can tell, has no lack of talented writers, so I am optimistic something will be written before too long.
Another reference you might want to look at is "Modern Perl" (http://modernperlbooks.com/).
And really, I would like something I can read offline, preferably as a PDF. I know we live an always-online age, but really, I want something I can read on the train where I have no Internet access, and I want to be able to search the documentation without having to send a request to a web server.
I am aware there are of http://www.perl6.org/documentation/, but the docs there seem to be ... not organized in the way my brain is used to.
Another reference that just comes to my mind is the Python documentation, which IMHO is superb. It's well organized, concise and to the point, without being spartan.
Just to be clear, I do not expect you to do all that work, but if you want starting points what I would like Perl 6 documentation to look like, now you know. ;-)
bwigfield · 2015-09-07
Modern Perl - http://modernperlbooks.com/
csirac2 · 2014-11-19
I want to write something concise and coherent, but it's not happening today :) Instead, assuming you've read the teasers in the Moose manual [1] I'd recommend this [2] interesting comparison of how horizontal code re-use can be achieved in Java, Ruby, PHP and Perl+Moose. There's more philosophical/winding essays on Moose from Chromatic, for example at [3].
Roles/traits/method modifiers/MOP/composability etc. are all great things for getting more reusability... however (and this might sound stupid) the thing that saddens me most when writing Python code is when I find myself adding a bunch of asserts or adding program logic "manually" in situations where I'd normally specify that sort of thing declaratively in a Moose class definition or by referring to a centrally managed Type or delegate stuff through attribute features.
On the other hand, I'm barely into year 2 of full-time Python dev, so perhaps I've yet to find the idiomatic way of doing Python things I used to take for granted in Moose.
Regarding Perl 6, I don't know much about it, except that the original authors of Moose had some inspiration from it.
Is picking up Perl+Moose mind-expanding? It was for me, but I feel that what Moose gave me in Perl was a bit of a band-aid over the fact that it's such a malleable open-ended dynamic language. So as a C++/Java programmer this aspect might not be so enlightening to you, except to see how Moose achieves it in a pretty painless way that I think is very nice and…
Renaud · 2013-12-23
Old debate, it's a core philosophy or the language. It's a bit like complaining that there are a 100 ways to cook chicken.
Personally, I like the freedom that Perl offers. Perl 5.x is still widely used in some industries, finance and banking for instance, and it's still the glue that holds 'nix systems together (have a look at the scripts in the bin folders of any distro).
Following Modern Perl[1] best practices, you can write powerful, meaningful and expressive Perl 5 without shooting yourself in the foot.
Perl 6 is another beast, it removes many of the ambiguities present in Perl 5 and introduces more functional paradigms.
At its core, Perl remains a multipurpose tool. The fact that there are multiple ways to do a thing is not bad, whether it suits you or not is a matter of personal preference really.
So, if someone is curious about Perl, they should be encouraged to try it and find out for themselves if they like it or not.
[1] http://modernperlbooks.com/books/modern_perl/
dinkumthinkum · 2013-05-20
I get that this is an issue that bothers PG. I also get that this particular comment you're singling out might be an example of it, but I'm not sure. However, I'm not convinced that every instance that looks like the alleged problem is really a problem in itself and, perhaps I am in a minority, do not believe this sort of thing is the downfall of HN.
For me, I think the issues that make discussions go "downhill" are less to do with criticism and much more to do with prevalence of group-think. I don't think the prevailing wisdom that pointing out fundamental errors of facts of faulty arguments is a bad thing, even if they are not the main point of the article. I think there is edifying value in such criticism. Now, it is true that an article may have value beyond it's minor or major inherent fallacies and errors. Criticism is not censorship and it does not prevent others from reading and discussing other parts of an article if they are interesting and fodder for good conversation. Nevertheless, I don't think being overly generous or charitable necessarily the best method or should be enforced via an algorithm or community brow beating. No one wants inane Reddit conversations but I don't think most want sterile group-think or hug sessions either.
HN has all kinds of users with different backgrounds and some users are very knowledgeable and critical and we can learn a lot of have great discussion regarding the criticism as the more traditionally positive style conversations.…