The Dark Balloon

A weblog by Hao Lian.
A terrible secret guarded by golems.
A note that thanks you for being born, all those years ago.

§
A beginner’s guide to manhandling Perl, 1.

Hello. The assumptions for this post are that you have some exposure to programming, no matter how brief. This makes the tedious stuff—for loops, if statements, subroutines, typing on a command line—go by faster and the fun stuff get here earlier. In other words, if you understand Dive Into Python, you’re my audience. Congratulations.

“But, Dr. Writer, why write another Perl tutorial?”

(Please, call me Herr Writer.) In short: Most Perl tutorials are either out of date or they don’t really address the obstacles most newcomers face head-on: references, Perl’s special definition of subroutines, and why everything gets complicated after scalars.

“OK, I grudgingly accept your premise.”

The first step to programming in Perl is downloading Perl 5.10. For Windows, there’s Strawberry Perl. Perl 5.8 is already installed on Macs. (5.10 requires building from source, which is unfortunately outside the purview of this novel.) Linux distributions have package managers.

Next time: Syntax! A scratch program!

[(2008 October 26) .]

What are the advantages of Strawberry Perl compared to, say, ActivePerl?

The biggest difference is that cpan works out of the box on Strawberry Perl, I’d say. Secondarily, I think both the momentum and inertia of Strawberry Perl have far surpassed ActivePerl.

perl -MCPAN -e shell generally works for me, but I prefer ActiveState’s proprietary ppm. But I guess that’s because change scares me.

Change pals around with terrorists, you know.

Abandon your ideas.

Use Markdown+, but not HTML. In code blocks, beware angle brackets.