by cpplinuxdude · 11y ago · 0 comments
Initially it was used to extract tables from text documents, and its always had a strong focus on text manipulation and regular expressions.
Its implicit variables and syntax mean you can write very, very concise code. Yet by following stylistic guidelines of your choice, you can write code that looks sane and maintainable.
I really like the fact you can import os commands and call them as a part of the language. It makes writing scripts a breeze. In fact writing anything in perl is a breeze. Check rosetta code, you'll see Perl 6 is one of the most concise at every turn.
As much as I really like python, I find that calling system commands is a pain.. calling os.system is obviously far from great, and calling subprocess can get cumbersome.
I haven't played with perl in a while, but my past experiences with perl was always getting a lot done, with very little work.
I worked with Perl for 4 years, and while it's not the gauntlet of pain that people make it out to be, there were several annoyances (like needing to always hit the docs for that stuff).
I understand it's a trade off. We don't have a large standard library in Perl like Python does, and that means there's a bit of searching required to find what to use, but that's often a benefit as well as a drawback. Would we have Path::Tiny if we had something that provided some but not all of the capability, and not as well? Would we have DateTime (or would it be popular) if we had a core DateTime-like module that was problematic, but mostly worked? Part of the beauty of having a small core set of libraries and an large and vibrant set of extended libraries is that the constant churn leads to newer and better things. Really what I'm lamenting, is that while there are these benefits to the churn, it still does lead to some painful situations where you find you've been using a poor choice for your needs just because you didn't know of the better choice that was out there. It's acceptable if it leads to DBIC, DateTime, Path::Tiny, etc, but it still sucks some times.
What did you use it for, if I may ask? What how big a project are we talking about?
I would have thought hitting the docs wouldn't be a part of the annoyances list. Did you feel you had to hit the docs more than with any other language?
Have a look at the 'sh' python module to ease your pain: http://pypi.python.org/pypi/sh
For me the greatest advantage of the Perl5/shell integration is that you can use Perl's sane data structures, flow control, and code organization features instead of their bash equivalents which have endless pitfalls and can be less portable than basic Perl5.