This is what is technically known as weasel-words. There’s more where that came from. He points out that Perl is strictly a legacy language now; no new software being written in it. For example the BBC’s new iPlayer which runs on the same Perl framework Sedition·com does was written via time machine by hackers who travelled to the past where Perl is still in use.

What really burns is that I know what readers think when they read the article. No one is convinced by his conclusion because he doesn’t pick C#, Ruby, Java, or Python. So all those guys are going, “Oh, that’s totally right. Perl sucks and all the others are losers too except for (C#|Ruby|Java|Python), the lingo in which I hack. He just didn’t get the bigger picture. Of course (C#|Ruby|Java|Python) is the right choice.”

Anyway, the closer is: “Scala wins and here’s an example of why: <code/>.” Go look at it. Then come back and look at this–

Dice game Perl

usestrict;usePod::Usage;useGetopt::Long;useNumber::Formatqw( format_number format_price );my($plays,$bet);GetOptions("plays=i"=>\$plays,"bet=f"=>\$bet);$playsand$betorpod2usage(-verbose=>2);my$start_money=my$money=$plays*$bet;for(1..$plays){my$roll=int(rand(100))+1;if($roll<=50){$money-=$bet;}elsif($roll>=66and$roll<=75){$money+=0.5*$bet;}elsif($roll>=76and$roll<=99){$money+=$bet;}elsif($roll==100){$money+=2*$bet;}}printf("%s became %s after %s play%s:\n\t",format_price($start_money),format_price($money),format_number($plays),$plays==1?"":"s");printf("You get %s for a dollar\n",format_price($money/$start_money));=head1 Question: Do you want to play this game?
You put down some money and roll a die between 1 and
100. Depending on your roll-
1-50 --> I keep your money
51-65 --> You get your money back
66-75 --> You get 1.5 times your money
76-99 --> You get 2 times your money
100 --> You get 3 times your money
B<Arguments>-
-plays How many times to play
-bet How much to bet on each play
I<Do you want to play?>
=cut

You’ll note that as reported, although they read almost exactly the same, the Perl is unreadable. Or is it the Scala? Damnit, now I don’t know whathow to think for myself.

Additionally, the Perl is a complete program runnable with flexible, type-filtered arguments. The Scala requires more code be written to run with other parameters. The Perl is self-documenting—code comments are not documentation. And the Perl correctly formats numbers and currency based on locale—halfway to i18n without hardly trying. Three big improvements over the Scala version and in nearly the same space with some easier reading, frankly. and and or read much more naturally than && and || and make lots of code less cluttered because their weaker precedence allows the omission of parenthesis.

Usage

jinx@jasper[2260]~>dice-game -bet 1 -plays 100
USD 1,100.00 became USD 850.00 after 11 plays:
You get USD 0.77 for a dollar
jinx@jasper[2261]~>dice-game -bet 1 -p 100
USD 100.00 became USD 74.50 after 100 plays:
You get USD 0.75 for a dollar
jinx@jasper[2262]~>dice-game -b 7 -plays 100000
USD 700,000.00 became USD 564,413.50 after 100,000 plays:
You get USD 0.81 for a dollar
jinx@jasper[2263]~>dice-game -b 1.01 -p 1
USD 1.01 became USD 2.02 after 1 play:
You get USD 2.00 for a dollar

Not convinced? I know, logic and proof is difficult for human beings to follow. You get emotions though, right?

PS: You can embed Java, PHP, C, C++ and more in Perl and any time someone tells you something positive about another language ask them, “Can Perl do that too?” And when they say, “No,” walk away ’cause they don’t know what the ƒµ¢%1 they’re talking about.

PPS: We also note that the article in favor of Scala was delivered by a site coded in PHP. Of course it’s too much to expect one to code one’s own blog in one’s favored language no matter how convinced one is that said language is ideal… Well, you know, unless it’s Perl, I guess. I wrote this one and I did it in a month because Perl and its many packages are that easy and fun to use.

PHPS: If this has led you to conclude Perl hackers are asocial jerks, rest assured they are not. Not all of us, anyway.