
In Praise of Perl 5 - Mithaldu
http://ledgersmbdev.blogspot.com/2014/02/in-praise-of-perl-5.html
======
guylhem
I don't care how un-sexy perl is by current standards. It's damn efficient,
even for new projects. Also, it's not hard for a developper worth its salt to
get productive in perl.

At the moment I'm playing with some threaded perl to parse very large text
files - part of the code was developed by a C++/Java/js fan, who just realized
it was the best tool for the job, and created that after a few days of playing
with perl.

~~~
Pacabel
But is that really unique to Perl these days? It may have been true in the
mid-1990s, but things have changed since then.

Python and Ruby both have a much cleaner syntax, yet still offer very
comparable functionality, excellent portability, ample standard and third-
party libraries, excellent documentation, supportive communities, great regex
support, and basically everything else that Perl offers.

Since everything positive about Perl is also offered by alternative languages
today, and those alternatives are themselves much better than Perl in some
respects, Perl seems like a less and less enticing option each day.

~~~
PuercoPop
Perl has reader macros and a meta-object protocol upon the object system is
built with. Ruby and Python don't have either AFAIK. That is an example of
what the OP is saying with Perl is an extensible language.

~~~
systems
how does Perl have reader macros, can you please point to a link if possible?

i couldnt find this one simply searching online

~~~
mst
Look at Devel::CallParser and Keyword::Simple

------
mmaunder
I've used Perl extensively inside the BBC, Credit Suisse First Boston and a
few other big corps. Also was a dev on a global warehouse management system
written in Perl. But saying your startup is using Perl is not going to get you
funded or laid anymore (and I miss grunge too) so there's not much love for it
in Valley/Incubator circles.

These days I'll drop into coding in Perl for the regex syntax and backticks.
But the reality is there's not much difference between it and PHP in terms of
features. Used to be that it was better than Ruby because of performance and
stability but they're about par now. So I don't think there's much point in
evangelism or debate about Ruby vs Perl vs PHP or even Java anymore because
they all get the job done in pretty much the same way. From a practical PoV
I'm more interested in languages that actually do something well that other
languages suck at e.g. node. I wrote a FSM/Long Polling web server
implementation in Perl using epoll() before Node came along and now I love
node more than most (and still wear the scars from a particularly tough
hashref autovivification bug).

~~~
eieio
> and still wear the scars from a particularly tough hashref autovivification
> bug

As an infrequent perl programmer[1], I'm curious about the bug. Googling tells
me that perl if($foo->{bar}) will always pass, which is pretty goofy to me.
Was it something like that?

[1] Well really, a bad perl programmer. I've occasional had to make minor
edits to legacy perl. I don't write perl. And, as the mistake in this post
shows, that's probably a good thing :)

~~~
seeken
That will not always pass.

if (exists $foo->{bar}){ .. will not run .. }

if ($foo->{bar}) {...}

if (exists $foo->{bar}){ .. will run .. }

~~~
pflanze
That doesn't do any autovivification. You meant (note the referencing down a
deeper level than the exists test):

if (exists $foo->{bar}){ .. will not run .. } if ($foo->{bar}->{baz}) {...} if
(exists $foo->{bar}){ .. will run .. }

~~~
seeken
Can't believe I've had that wrong for so long. Must have misinterpreted it
right when I learned perl and have always been careful about it.

------
nine_k
Perl, above all, is an incredible cluster of experiments in language design,
and a work of art.

Despite that, it's also a relatively practical and reasonably popular language
(else it would end up among esoteric languages).

The very richness, intricate ornamentality, flamboyant conceptual exuberance
and non-orthogonality that make it an art object also make it unsiutable [for
me] for real development. I like my tools compact and precise.

~~~
kbenson
Interesting. I like my _use_ of those tools to compact and precise, which is
why I value Perl. I find the expressiveness lets me convey the meaning of the
code with a minimum of boilerplate.

------
dionidium
_" These posts are aimed at software engineers more than developers"_

I don't know what this means

~~~
beat
That means you're a developer.

~~~
nfoz
In Canada, you have to be an accredited professional to use the word Engineer
in your title. This means being a member of a specific association, meeting
professional standards in your work and qualifications. This is enforced in
part by a trademark on the word "engineer".

In the U.S., there is no such requirement. Anyone can "be an engineer". Now
that I work in the US, I call myself a software engineer or a software
developer or a programmer, as interchangeable terms.

If there is an actual distinction here I would really like to know it. I also
wonder how much these terms may have different meanings in other
countries/regions.

~~~
bunderbunder
In the US, these words have different meanings in different companies.

At my company (fairly big - Fortune Global 500) I'm pretty sure they have
different meanings in different _product teams_.

------
perl_uber_alles
Perl is the best. I take Perl over (Python|Ruby|Php) any day of the week!

------
beat
Bah. I learned Perl with Perl 4, which was a lovely little regularization of
sed, awk, sh, and unix system calls. Absolutely fantastic, loved the heck out
of it.

Perl 5 is an abomination.

~~~
eieio
I have 0 familiarity with Perl 4, and some(but not a lot) of familiarity with
Perl 5(I have maintained Perl, I don't ever use it for a new project).

What makes you call it an abomination? I'm not a big fan of the language, but
I have no idea why it'd be worse than Perl 4.

~~~
beat
Three words, in quotes… "object oriented programming".

------
Thetawaves
I don't know why this guy thinks it's a good idea to create his own idioms and
language features which inhibit the ability to understand the code by pretty
much anybody else.

~~~
BugBrother
Uh, no.

That wasn't his own language features, he used Moose in the last example, it
is the standard OO environment in Perl. To simplify a little, most new Perl
code use Moose.

The author did discuss a bit how Perl is extendable, which is where Moose
comes from.

~~~
einhverfr
To be clear, I am also the author of the PGObject::Util::DBMethod which adds
the dbmethod() syntactic sugar used in the third class.

One thing to note is that this was done specifically in the way it was so that
it would fit in with Moose-like idioms, so it is more a matter of extending
the Moo(se) way than it is creating a whole new idiom.

------
systems
tl;dr

here are lines from the article to summarize it

"The .. point is that Perl 5 gives you a way to build .. (DSL's) that can be
seemlessly worked into a general purpose programming environment."

"Perl is a language many people love to hate. Here's an example .. of sloppy
coding"

"It is very hard to modify safely."

"it is possible to do this sort of thing in any language."

"Let's try this newer Perl code"

"This .. is easier to maintain, and is easier to understand."

"The above two examples ..neither one really shows what Perl is capable of
doing"

"Perl itself is a highly malleable language and .. allows you to define
domain-specific languages for parts of your program"

"Here's a small class for handling currency records."

"Now the code above .. is effectively entirely declarative."

"What differentiates the examples .. is .. readability, testability, and
maintainability."

"How does that work?"

"Perl is a very flexible .. you can add functions that behave .. like
keywords."

"The example here uses two modules which provide DSL's for specific purposes."

"The first is Moose"

"The second is PGObject::Util:DBmethod"

"Why is this Powerful and Productive?"

"Compare a framework built as a mini-DSL specification language to one built
as an object model."

"In an object model framework one .. has to juggle object-oriented design ..
with the desire for greater flexibility."

"DSL's .. allow you to define the object model orthogonally to the framework"

"Other Similarly Powerful Languages"

"Lisp"

"Rebol and Red,.. implementations are still very immature"

"Metaprogramming helps to some extent..in Ruby and Python .. but .. makes it
much harder to build a framework that is truly orthogonal to the object
model."

" Perl isn't just a programming language, but a toolkit for building
programming languages inside it. "

~~~
draegtun
The full statement from the article was - _Rebol and Red, whose open source
implementations are still very immature_

To clarify this…

1) Rebol 2 is a very mature product. But while free to download & use it
remains closed source with no long term future.

2) Rebol 3 is an alpha/beta opensource rewrite of Rebol 2. While Rebol 3 isn't
has mature as Rebol 2, it is robust and does run about 2 times faster than
Rebol 2 and with other significant design & implementation improvements.
However it is incomplete and missing some Rebol 2 features.

3) Red could be viewed as "very immature" because the implementation was only
started in 2011. However it is looking very promising and I believe the aim is
to get to version 1.0 by end of this year.

------
rikacomet
A few words in appraisal of perl over fcgi?

~~~
kanatohodets
Check out [http://mojolicio.us/](http://mojolicio.us/) for a more modern take
on web dev in Perl -- the most common deployment is a nginx reverse proxy in
front of the built-in (non-blocking and preforking) web server -- just like
suggested setups in node/python/ruby/etc.

One cool bonus that mojo provides is hot deployments, so there's no need to
restart the server process to get new code.

