Phillip Pearson - web + electronics notes

tech notes and web hackery from a new zealander who was vaguely useful on the web back in 2002 (see: python community server, the blogging ecosystem, the new zealand coffee review, the internet topic exchange).

2005-10-9

Python to Perl

Argh, after a few years of Python programming, Perl syntax is a pain in the ass to relearn.

Finally figured out that {'asdf' => 'foo'} returns a hash reference. To get a plain hash, you don't use curly brackets - it's just ('asdf' => 'foo'). I knew arrays did this - that typing [1, 2, 3] gave me an array ref and (1, 2, 3) gave me an array - but didn't realise that hashes behaved the same.

Languages like Python that don't make you jump through hoops to use references are nice, but they make life difficult when you want to go back to lower level languages like Perl or C...