4 ms·
I don't use Perl for anything that I suspect will amount to more than 1,000 lines of code. But for smaller scripts that automate tedious tasks or massage data
by krylon 9y ago
I don't use Perl for anything that I suspect will amount to more than 1,000 lines of code.
But for smaller scripts that automate tedious tasks or massage data to connect two otherwise software systems or generate a report-ish overview of a database/table, it is very hard to beat. Ruby comes close, but then again, Perl has been relentlessly optimized and fine-tuned over the last ~15 years, so for the stereotypical use-cases it is actually very fast, even compared to what one could cook up in C without weeks of hand-optimization and tweaking.
Someone once said that Perl is to batch-processing of text what Emacs is to interactive editing. I think the comparison is somewhat accurate.
- rurban 9y agoon the contrary perl5 has been relentlessly de-optimized and destroyed over the last ~15 years by its maintainers. how did you get to this interesting opinion? do you really believe the p5p marketing hype? perl5.6.2 still blows away all newer releases performance and memory usage wise. 15 years ago the author was still active.
- i336_ 9y agoIt's sad you're being downvoted. I've found similar sentiment elsewhere, and I'm interested to learn more. stableperl (http://blog.schmorp.de/2015-06-06-a-stable-perl.html http://blog.schmorp.de/2015-06-06-a-stable-perl.html) is a fork of perl 5.22 with a couple of tiny reversions that re-enable access to some internal state required by certain CPAN modules. The author talks in other blog posts (http://blog.schmorp.de/2016-12-29-griefing-the-perl-api.html http://blog.schmorp.de/2016-12-29-griefing-the-perl-api.html, http://blog.schmorp.de/2015-11-12-tidbits-why-coro-crashes-or-how-perl-6-deals-with-bugs.html http://blog.schmorp.de/2015-11-12-tidbits-why-coro-crashes-o..., http://blog.schmorp.de/2015-12-15-tidbits-cgipm-a-data-point.html http://blog.schmorp.de/2015-12-15-tidbits-cgipm-a-data-point...) about the decline of Perl's cohesion. It's sad to see. -- EDIT: And now I'm being downvoted. I have no problem with Perl, I watched the Perl 6 presentation when it was released with great interest. Perl remains on my list of languages to learn (I know, I know...). It's up there. And that's why I said I was sad to see datapoints like the one I linked. I want Perl to keep going strong, and I hope it lasts another 20 years. I guess I added this comment because I wanted to find out if there was anything I could do.
- duskwuff 9y agoMark Lehmann and rurban are considered... let's just say, a vocal minority in the Perl community. Their opinions are not widely shared.
- i336_ 9y agoOh. That's unfortunate. Thanks very much for the headsup. I wouldn't mind learning more about this, perhaps via email (as an alternative to public discussion that might(?) start a flamewar).
- walshemj 9y agoand I think it has replaces a lot of code that back in the day would have been written in, bash sed and awk
- forinti 9y agoExactly. I have dozens of scripts in production and most are 30 lines or less. Most of them read various files and load them into our databases. I do this in perl, because I can cook them up in minutes. Java, which is the official language around here, is just too much of a bother. This week I realised that a script I wrote about ten years ago has become an indispensable part of my company's infrastructure: it converts Office documents to PDF using OLE. It's about 30 lines long of very clear code.