Back to Top

Friday, December 29, 2006

What I learned about Perl today

When you start using a new programming language for quite some time you will regularly find new things in it. Some will make you think I wish I knew this yesterday and some will seem interesting. So here is something I learned about Perl today:

If your recursion level exceeds 100 (meaning that you call yourself a 100 times from a subroutine without calling any other subroutine) and you have the use warnings; pragma set (which you should, it's good practice!), you will get a warning. This is very much inline with the main target of Perl (command line automation where you usually wouldn't find any deep recursion). If it bothers you, include the line no 'recursion';. For more details, see the manual page.

BTW, just so that you don't get the impression that I'm a total language zealot, here is a link to What's wrong with Perl ;). While I agree with it on most points, the fact that I can write shorter code seems a very big advantage to me (because I don't have to remember what method of the regular expression object to call, I just write =~ //). Also, to my big surprise, Python is around 10% solver when parsing text files. This seemed incredible to me (since I assumed that when parsing big - 100+ MB - text files the chocking point would be the harddisk), but after doing several tests I have to accept this.


Post a Comment

You can use some HTML tags, such as <b>, <i>, <a>. Comments are moderated, so there will be a delay until the comment appears. However if you comment, I follow.