> Sadly Perl has fallen on hard times. I think the Perl 6 debacle is mostly at fault.
I agree hard times. Hubris is at fault.
Perl did too much and reached for the stars. Its happy place was a sane job control language. A niche Python is filling.
I have used both, Perl extensively, Python when I must. Perl is much better, but being better is not enough.
Perl did "everything". Python was "object orientated". People wanted the shiny "object orientated" and, sadly wisely, did not want a language that could do anything and everything.
I blame Larry Wall, the genius, both for Perl's success, and Perl's failure. If only I could fail so brilliantly!
Python ruined Perl for me. As soon as I convinced my self that pass-by-object-reference really was that simple, and I didn't have to deal with pass-by-sigil-maybe, I never looked back.
Write a Python function that writes an object's string representation to a file:
and it works. OK. But what if I want to call it on a list of strings?
write(["spam", "eggs"])
That was too easy. I know - let's see if we can write a dict of tuples to sets of ints!
write({(1,2):{3,4,5},('spam','eggs'):{6,7,8}})
That freaking worked? And I didn't have to change the function to accept a hashref? You just pass an object... and it passes the object?
At first, I thought I had to be missing something, like maybe it was impossible to do trickier things because they made the simple things so easy, but no. It just turned out that some of Perl's design decisions increased my cognitive load way more than strictly necessary. That's clearly not true for everyone, but it sure was for me. The first day I wrote Python was the last day I wrote Perl.
> At first, I thought I had to be missing something,
Well, Data::Dumper is included in core Perl ...
use v5.12.0;
use warnings;
use autodie;
use Data::Dumper;
sub logit {
open state $log, ">>", 'c:/tmp/foo';
print $log Dumper(@_)
}
logit(123);
logit(["spam", "eggs"]);
logit({"(1,2)"=> [3,4,5],"('spam','eggs')"=> [6,7,8]});
# even logging multiple objects at once ...
logit(
123,
["spam", "eggs"],
{"(1,2)"=> [3,4,5],"('spam','eggs')"=> [6,7,8]},
);
NB: Perl has neither tuples nor sets, but there are workarounds.
And I opened the filehandle only once. And for append not overwrite like you did.
I don't think it was so much hubris as bad communication.
Perl 6 was understood to be that: Perl 6, a definite successor to Perl 5. But besides being very, very late it turned out not to truly be Perl 6, but a new, incompatible, Perl-ish language.
I think the decision to rename it to Raku was a good one, but came too late. By then the world had already moved on.
Done early enough I think it'd have fixed things. It'd have created the clarity needed to understand that Perl 5 wasn't going away, and that it was pointless to wait for a successor.
That loop, often in a command line invocation `perl -e 'while(<>){chomp;......}'`
My point is its happy place was not application programming, gui systems. AS I commented elsewhere here processing every Apache hook.
Pythin suffers the same problem. It too is brilliant at the little jobs, yet there are many GUI junk piles written in it, just as happened with Perl back in the day
> Perl did too much and reached for the stars. Its happy place was a sane job control language. A niche Python is filling.
> I have used both, Perl extensively, Python when I must. Perl is much better, but being better is not enough.
> Perl did "everything". Python was "object orientated". People wanted the shiny "object orientated" and, sadly wisely, did not want a language that could do anything and everything.
I don't know what kind of Python you've tried using, but it seems you got some defective ancient 2.x version. Python is exactly the kind of language that should be replacing Perl, simply because it's the best glue language out there right now, with modules that are actively being maintained and developed.
And, as a cherry on top, actually has human-readable syntax.
I agree hard times. Hubris is at fault.
Perl did too much and reached for the stars. Its happy place was a sane job control language. A niche Python is filling.
I have used both, Perl extensively, Python when I must. Perl is much better, but being better is not enough.
Perl did "everything". Python was "object orientated". People wanted the shiny "object orientated" and, sadly wisely, did not want a language that could do anything and everything.
I blame Larry Wall, the genius, both for Perl's success, and Perl's failure. If only I could fail so brilliantly!