After what was probably too long trying to avoid it, I'm finally diving head-first
into Perl. I feel learning Perl takes more investigative work than some languages,
as what's best practice is somewhat subjective and has changed since a few of the
more popular books have been published (e.g. Programming Perl).
I've made a few observations:
- Ruby borrows Perl's syntax more than I realized (e.g., postfix conditionals)
- The breadth of libraries available is amazing -- by far the best of any language
I've used -- and people really seem to be good about writing good docs for their code.
cpanminus is by far the best way to use CPAN; it works exactly
how I would expect a package management system would in 2010, unlike the bevy of
features you need to configure when using the perl -MCPAN -eshell CLI.
- Moose seems like a very impressive library, and seems
much more natural than manually blessing modules the "old-school" way.
- Variable Context-awareness is something that took me awhile to understand, but
now it seems natural to me. I think dealing with references adds another layer of
complexity that can be intimidating to new users having to deal with both at the
same time.
- I'm not sure about how argument passing is implemented in Perl, but thinking of it
as a simple stack makes the most sense to me.
- Implicit variable passing (
@_ and $_) seem like a bad idea for maintainability,
but really cut down on the tedium of dealing with variable names. I'm growing
to like the feature.
- Perl's efforts to be backwards-compatible has left it with a lot of vestigial
syntax; in a way it suffers from the same problems C++ does in trying to please
too many. The solution for a lot of teams using C++ is to use a well-defined
subset of the features, and I believe this parallels making sure to use the latest
features of Perl as well.
All in all I'm liking it. Next up: Clojure?