
Perl is 25 years old today - kamaal
http://perldoc.perl.org/perlhist.html
======
VLM
I've found over the past decade or so that when I write a "perl" program I'm
really writing about five lines of glue code around multiple CPAN packages.
Well maybe more than 5 lines for control flow, some business-logic error
handling, etc.

When I write in another language I spend a long time looking for a library
like the ten I'd find in CPAN, sometimes I find one but often enough not, then
a long time complaining about how if I used perl I'd have access to the
perfect CPAN module and therefore already be done with the whole project, then
basically reimplement the CPAN module in the smaller inferior language, then
finally write glue logic to link stuff together.

I never fail to be amazed when I see pages and pages of an inadequate homemade
xml parser written in an inferior language or maybe a blizzard of regex, and
then hearing bragging about how in Perl the elegant alternative language code
would closely resemble line noise. No, in Perl, those pages and pages of buggy
code would instead closely resemble one line: "use XML::Simple;" Repeat a
zillion times over.

My "perl" programs / systems actually shrink in length over time rather than
expanding, which is unusual in smaller languages.

~~~
mahmud
CPAN might be centralized, but Java libraries are far superior. This is not a
pissing contest, but a fact. The java runtime makes everything else look
amateurish and unprepared. Debugging, profiling, introspection and
distribution, all built into the platform. Attach to any running process and
analyze away. Perl is good when it works, but when it doesn't, it's cryptic
stack traces and `exit -1`, nothing meaningful.

~~~
jrockway
Not really true. Yesterday I was trying to debug resource-loading issues. In
any normal programming language, you can just strace it and you'll see where
the program is doing I/O and you can figure out where it's trying to load
files from. But if everything is in a jar, you don't see any OS-level I/O
happening when Java tries to load something, so you have to invent all-new
tools just to figure things out. When you switch to Java you throw away 40
years of UNIX for a bunch of private methods implemented by summer interns at
Sun 20 years ago. The third-party libraries are fine, but the core is not.

Also type erasure.

~~~
jbooth
I agree but if we're comparing Java to Perl, type erasure is only slightly
hacky compared to the whole 'bless' thing.

Funnily enough, they're both examples of the same problem, stitching new
features onto a language that was not at all prepared for them.

------
ChuckMcM
I've got an interesting relationship with perl. My first exposure was back in
the 80's when I was at Sun and perl was, to my taste, a shell scripting
language with the complexity of APL and the readability of Forth. I hated it.

When I took the job at Blekko they said "We do most of our stuff in perl" and
I was dubious about that.

However, now that I've been exposed to V5 for a couple of years and have
probably written a few thousand lines of code in it, I find its easier to
write a quick hack in than Python, and it certainly has a better 'command
line' feel than Java. But it wasn't until I started coding up a quick CMS type
gizmo for making HTML pages that I truly "got" the power of CPAN backing it
up. There is a _lot_ of stuff there. Folks like me who gave up on the language
in the V3/V4 days as "hopelessly hacky" should re-visit it.

~~~
trhtrsh
The V3/V4 days ended in _1994_ , before Java 1.0 was released.

<http://perldoc.perl.org/perlhist.html>

~~~
ChuckMcM
I was first exposed to perl at Sun Microsystems in 1989, I started working on
Java in 1992.

[http://stuff.mit.edu/afs/sipb/user/marc/hotjava/doc/people.h...](http://stuff.mit.edu/afs/sipb/user/marc/hotjava/doc/people.html)
(top left corner)

------
3amOpsGuy
Before i switched to Python as my general purpose language, i used to be a bit
of a Perl fanatic.

I've still to come across a language that lets you get your ideas down as
quickly. It's full of fantastic time savers, e.g. the for(<>) construct and
the format output functionality cover a bunch of common use cases in minimal
keystrokes (let me pipe in some data, analyse it, then spit it out in a clean
report).

It can hurt readability but for small one offs, it often doesn't matter.

~~~
ajross
My experience is almost exactly the opposite. Whenever I'm writing in Python I
can't escape the feeling that the code is simply _fragile_ due to missing
language features. Obviously this starts with all the regex initializations
(often quite distant in source from where they are applied) which make regular
expressions in python just a huge mess.

Perl's autovification allows me to build a data structure at parse time with
code that is trivially verifiable. Python forces me to sprinkle the code with
a thousand tests for whether or not the field is initialized yet, or write
extra code to define things like defaultdict instances (with syntax that I
always have to look up, and which in my experience most python programmers
don't understand).

Not to mention that if I want to use an OO syntax for that data structure I
have to write extra code defining a class for it (and inevitably be yelled at
by the pythonista security branch for all the __whatnot__ methods I forgot to
define).

Python's comprehension/generator syntax is nice, though, and doesn't have a
clean analog in perl. One thing it does do well is chaining up "filter"
operations on aggregate data structures in a clean way. And that has value and
is worth emulating. But honestly most of the rest of the language is junk
compared to perl or ruby.

~~~
asher
I agree with you about the feeling of fragility, especially with defaultdicts.

As for regexes - while they are somewhat clumsy in python, they don't have to
be defined distantly:

    
    
      m = re.match(r'(\d{4})', buf)
      if m:
        print "year: %s" % m.group(1)
    

The only thing that really bothers me about the above is the need to separate
the assignment of m from the test.

Re comprehensions: seems to me they are just Python's version of Perl's map
and grep.

grep:

    
    
      @good = grep { $_->{width} > 9 } @crates;
      good = [c for c in crates if c['width'] > 9]
    

map:

    
    
      @squares = map { $_ * $_ } @nums;
      squares = [i*i for i in nums]
    

Which is better? I think Ruby's way is the best, and Perl/Python are a wash
here.

Now, on the autovivification note, I wonder if we can make a Python class that
has the desired behaviors. Like:

    
    
      c = PerlishStruct()
      c['foo'][17]['bar'] = 'baz'
    

You don't really think it's junk, do you? Perl, Python and Ruby are extremely
similar; I'd say Perl's more ergonomic, but messier; Python's cleaner, but
sometimes awkward, and Ruby pretty much has the best of both worlds.

~~~
berntb
You probably shouldn't do this in an inner loop: :-)

    
    
      m = re.match(r'(\d{4})', buf)
    

'map' is more general than just the single, convoluted statement of list
comprehensions, which really seems as a kludge from unwillingness to accept
multi-line lambdas. So something new was invented that had to be learned; then
it was argued it is a boon. (Like references in Perl. :-) )

(There is some defaultdict functionality for autovivification in Python iirc.)

Yeah, they are all similar. I don't know enough Ruby to have an opinion.

------
maligree
I'll raise the glass: here's to Perl, for being the first language I could
actually get shit done in.

Unmaintainable? Who cared. Got shit done. Too many ways to do things? Who
cared. Got shit done.

I have this totally false feeling that BACK THEN* we wrote IRC bots and we
were happy. And `perl -e '"A"x800'` was the destroyer of worlds.

* - shit, I just realized I'm young.

~~~
5teev
I like that Perl tends to do what you wanted it to do, rather than what you
told it to do. Bugs in other languages are often because of vice-versa.

------
FigBug
Perl is 25. Python is 21. Lua is 19. Ruby is 17.

Interesting how I consider Perl an 'old' language, and the others new
languages. I guess it says more about how revolutionary Perl was at the time
and how quickly it became widespread. The only other language I know of that
went from 0 to everywhere in under 5 years was Javascript.

~~~
felideon
Common Lisp is 28, which a year younger than C++ and not much older than Perl.
So not a dinosaur language as some people think. <g>

~~~
prodigal_erik
Lisp was invented 54 years ago. The Common Lisp standard is the capstone on an
unusually long and fractured history of development. Fortunately many of those
good ideas have trickled down over the decades, making mainstream languages
steadily less terrible, and competing proprietary implementations are no
longer commonplace.

~~~
derleth
> Lisp was invented 54 years ago. The Common Lisp standard is the capstone on
> an unusually long and fractured history of development.

Hm. If we do this, then C++ is merely one 'capstone' on the history of Algol
development, which is about as old as Lisp is.

------
kamaal
Here is another article covering a good deal of detail about Perl in its first
25 years, Its a great read: [http://news.perlfoundation.org/2012/12/the-first-
twenty-five...](http://news.perlfoundation.org/2012/12/the-first-twenty-five-
years.html)

------
adrianhoward
Work stuff is mostly Ruby, Python and PHP. Entertainment is Clojure (mmmmm....
Lispy goodness) and Haskell ATM.

But for my own stuff I still reach for Perl. Best testing infrastructure on
the planet and that, in combination with CPAN, lets me get shit done.

~~~
peteretep
I interviewed you once ... approximately forever ago ... and you told me at
the time you were just switching to using Ruby for fun stuff, while using Perl
for work. I'm glad you switched back, and appreciate your excellent CPAN
modules!

~~~
adrianhoward
I have completely forgotten the interview I'm afraid - but I'm glad you're
glad ;)

------
ojosilva
Here's Perl 1.0, published by Larry on comp.unix.sources 25 years ago
("Revision 1.0 87/12/18 13:07:40 root").

[https://groups.google.com/group/comp.sources.unix/browse_frm...](https://groups.google.com/group/comp.sources.unix/browse_frm/month/1988-02)

    
    
                           Perl Kit, Version 1.0 
     
                       Copyright (c) 1987, Larry Wall 
     
          You may copy the perl kit in whole or in part as long
                as you don't try to make money off it, 
                     or pretend that you wrote it.

~~~
mstevens
Slightly self-promotion, but you can get a variety of old perl sources at
<http://www.etla.org/retroperl/> (collected by someone non-me, I can't
remember who though)

I had thought someone had done a perl 1 release that built on modern systems,
but on a quick hunt I can't find it.

~~~
perlgeek
The perl source repository quite many historic releases also, and the first
few commit messages also contain the accompanying release notes.

See for example
[https://github.com/mirrors/perl/commit/8d063cd8450e59ea1c611...](https://github.com/mirrors/perl/commit/8d063cd8450e59ea1c611a2f4f5a21059a2804f1)
for the perl 1.0 annoucement (click on the [...] link to get the full commit
message).

~~~
mstevens
ooh, cool, I didn't know that was there.

My more active interest in perl was pre-git :)

------
kablamo
The stats in the link are interesting. I recently discovered the
Code::Statistics module (<https://metacpan.org/module/Code::Statistics>). It
tells you the cyclomatic complexity of your code which wikipedia tells me is
basically the number of possible paths through your code.

It might be fun to see that run against the Perl core.

I also like looking at the number of lines of code. If your features go up
while complexity and lines of code go down -- that could be a good sign.

------
knighthacker
Happy Birthday, Perl :). At Crowdtilt, we are proud to have the majority of
our stack Perl based. w00t w00t CPAN :)

~~~
bobochan
Came here looking for someone else wishing Perl many happy returns as it
reaches this august landmark.

I have been working as a programmer for 25 years and started using Perl in
1993 or so. I cannot express what it felt like to have this incredibly
powerful tool that seemed to integrate all of the sed, awk, shell, and C code
that I had for research. Using Perl absolutely felt like magic, particularly
for analyzing text.

I love Python, Ruby, and Lua too, but Perl will always be the tool that
quickly gets things up and running.

------
hippich
I believe most mainstream languages used for web development are quite old
now. And today it is matter of personal taste to choose one over another one
unless you are constrained by coding standards.

To me Perl is awesome :) Too bad I do PHP for a living, but I still enjoy it
when doing something for myself. Like last time I learned about web framework
Mojolicious ( <http://mojocasts.com/> ) and built <http://gotldr.com> and
<http://hntldr.com> leveraging Mojolicious and Redis -
<https://github.com/hippich/perl-tldrer> . It took me few evenings, but I
really enjoyed tinkering it.

------
smoyer
Twenty-five years already? Now it can retire with full benefits.

------
kenshiro_o
I haven't written a single line of Perl for over a year now and can't remember
much of the language - and I am sure I would not even be able to understand my
own code anymore!

Perl is a very handy and powerful scripting language but it should not be
considered as a durable solution. Whatever is quickly hacked using Perl should
be probably rewritten in a much more structure language, especially if you
plan on maintaining this code.

~~~
singingfish
Of course one can also write perl with care and attention. Perl::Critic, the
Moose family, and appropriate use of the CPAN really helps with that
discipline.

------
draegtun
Birthday cake! <https://twitter.com/TimToady/status/281119953741029376>

------
runarb
Unfortunately it looks like the interest in Perl may be fading a little
according to Google trends:
[http://www.google.com/trends/explore#q=perl%2C%20python%2C%2...](http://www.google.com/trends/explore#q=perl%2C%20python%2C%20&cmpt=q)
(Perl vs Python for comparison)

~~~
Mithaldu
Please do yourself a favor and mouse over the letters indicating news
headlines. :)

------
j98h
I like perl "expression": perlguts, bless, sv_2mortal, etc i feel we are
listening the same song :)

------
trhtrsh
As always, XKCD sums up the situation: <http://xkcd.com/224/>

------
ante_annum
Do people really still use Perl? It seems to have yielded greatly to other
languages in the past few years.

~~~
Mithaldu
Absolutely: <http://stats.cpantesters.org/trends.html#stats6>

------
indubitably
And Perl 6 is 24

~~~
draegtun
Considering perl5 is only 18 years old then somethings gone very awry there :)

Perl6 is looking quite _fresh_ considering how old you think it is. I just
submitted an article I'd seen to HN which shows how a formula like...

    
    
      4.7kΩ ± 5% 
    

... can be parsed inline with Perl6 code.

<http://news.ycombinator.com/item?id=4939204>

~~~
indubitably
I was just joking :)

It's interesting to me how often people cite "Unicode in code" as some sort of
amazing thing. I once posted on S.O. about the idea that maybe we should have
a programming language where the vast array of options in Unicode were
exploited to make things like Regular Expressions more readable (avoiding the
backslash plague alone would be worth it).

I got smacked down by people complaining that they didn't know how to type
anything but ASCII.

Sigh.

~~~
draegtun
_Jokes_ tend to get downvoted on HN and there's been a few (to many) _jokes_
in this HN post :( Your's the only one I didn't downvote because decided to
leave a comment instead.

re: Unicode - Perl6 does already use unicode characters for some of its
operators. Take the Hyperoperator »«
(<http://perlcabal.org/syn/S03.html#Hyper_operators>):

    
    
      my @a = 1..5;
      my @b = 6..10;
      my @c = @a »*« @b;   # =>  6, 14, 24, 36, 50
    

And there are _> >_ & _< <_ synonyms for those who find using unicode chars
too odd:

    
    
      @c>>++;   # =>  7, 15, 25, 37, 5

~~~
indubitably
Italicizing "jokes" is a very serious accusation.

------
frozenport
This one is a real perl see --

    
    
                               |
                              \|/

[http://stackoverflow.com/questions/7617852/whats-the-
differe...](http://stackoverflow.com/questions/7617852/whats-the-difference-
between-carp-croak-cluck-confess-and-verbose-options)

~~~
meaty
I vomited a little when I read that :)

~~~
RyanMcGreal
I was going to downvote your comment, but then I clicked through and read the
linked question and commentary.

~~~
bcoates
I don't get what the issue is, I don't even know Perl and it seems pretty
straightforward to me: Carp is a library with a set of mnemonic assertion
functions for libraries to signal usage errors committed by their callers.

Do people just prefer one function with a bunch of fiddly little enums or
something?

~~~
meaty
In my case I prefer sensible pragmatic names with some sort of hierarchy
rather than random words from the dictionary.

------
Raz0rblade
should have died 20 years ago its an awful language in my opinion

------
antoni
What can I say, it's time to die.

~~~
berntb
A karma 3 account.

Where are the Perl-hating trolls coming from on HN?

(I thought Guido said that it was time to stop trolling, so it isn't Python
people now?)

~~~
smoyer
Hate is an emotional response that humans have ... how can you tell if the
comment was trolling or simply a visceral response?

I don't hate Perl (I first learned CGI programming with it), but I do think
there are better ways to write maintainable, enterprise scale software. There
are two main problems with Perl (as I see it): 1) The language is so
permissive that it allows newbs to write bad code but still obtain results.
Habits, both good and bad are learned! 2) Perl experts seem to delight in
writing code that's "tricky" (for lack of a better word). It's like a contest
to see who can wring the most out of one 80-character line of code and it
leads to mid-to-low functioning Perl programmers being confused.

~~~
berntb
>> The language is so permissive that it allows newbs to write bad code but
still obtain results

I can't see any relevance for a _professional_ choice if newbies can shoot
bigger holes in their foot with a certain tool.

That is a natural result of a powerful tool.

>> Perl experts seem to delight

Anecdotal. Ten years old description of half humorous use (and exercises).
Also very different from best practices even then -- and especially different
from how many/most work today.

Let me also note: If Perl wasn't better in many ways, you trolls would make
serious arguments instead of " _experts seem to delight_ "... [Or as you wrote
above " _Twenty-five years already? Now it can retire with full benefits._ "]

But I'll bite a little. Perl has the best OO system of all the scripting
languages (Moose). The CPAN is the gold standard for scripting languages (and
probably everything else). The testing culture is afaik second to none. The
same goes for Unicode support. And so on.

~~~
slurgfest
I respect Perl and people who use it, but this is a telling cultural artifact:
<http://www.ozonehouse.com/mark/periodic/>

I am not posting this to bag on Perl, but just to show its fingerprint. If you
find that periodic table to be funny or cool then you are a lot more likely to
be happy with Perl than if it makes you shudder.

~~~
berntb
You claim to _really_ not be aware that table is for a quite different
language -- Perl 6?

That point has been made many, many times.

Edit: To the _cultural_ question, there might be a point. I might add that I
don't know Perl 6, but it seems like an insane amount of cool/fun toys (macro
language like lisp with an Algol-like syntax?! If they can pull that off it is
incredible.) That might say something about me and Perl people. But people I
admire use both vim and Windows, so I'm not certain.

~~~
slurgfest
I also think Perl 6 has some really cool and innovative ideas. Far from using
it to smear Perl, I think it is more interesting than previous versions.

But you are in denial if you think that this chart isn't a reasonably
representative cultural artifact of the Perl community and the Perl aesthetic.
Perl 5 is not exactly poor in operators, and it is the same core community
which produced both.

I don't think that Perl is bad. I am saying that Perl is very strongly what it
is. And while some people won't like that aesthetic, I don't see why anyone
should apologize for it.

~~~
rjbond3rd
Is there really such a great difference between operators vs.
class/method/function names? E.g., Math.pow() vs. __?

~~~
mdellabitta
There's a huge difference in searchability for one.

~~~
rjbond3rd
Maybe, though personally, "perl operators" has never failed me in Google.

~~~
berntb

       $ perldoc perlop

