3 ms·
>It's still difficult to beat perl in a production Unix environment to fix a hot issue, especially if you know your way around regular expressions. That may ha
by Falling3 14y ago
>It's still difficult to beat perl in a production Unix environment to fix a hot issue, especially if you know your way around regular expressions.
That may have been true at one point, but what advantage does Perl now have to any number of other languages with great RegEx support?
- kbenson 14y agoFirst, it's not just just good regex support, it's easily accessible features from the command line so you can quickly iterate to a solution. I'll often need to pull some very specific information out of a very large log file, and often Perl is the quickest way to achieve that. i.e. # pseudo-code head -n10000 LARGE_FILE | perl -ne 'next unless my ($foo,$bar) = /include/gsmi; ${foo}+=$foo, $h{$bar}.=$bar}; END { print %h }' Once you're happy with results on smaller data sets with head, replace with cat. I used a similar technique to quickly identify, classify and determine the user account for a large set of hacked Wordpress accounts at an ISP I worked for. Secondly, Perl is still the leader in regex development. They are still adding features that other languages are adopting (there have been a few good ides from outside they've taken as well, such as named captures, so credit where it's due).
- ceautery 14y agoIn my production environment, it has the advantage of being installed as part of our default Unix build. Most of our devs use tools like Weblogic, webMethods, Informatica, etc., and a few of us old fogeys are still around supporting Korn shell and perl scripts we wrote a decade ago. We don't have many bleeding-edge Linux hackers pushing Ruby, Python, Mongo, etc., which in my opinion is a shame.