Perl Gripes


Many many years ago, I used to write a lot of perl code. Then I discovered PHP and thankfully I didn't have to use perl anymore. As a result I have forgotten many of the perl tricks that I learnt. Now you might say that is good news, unfortunately occaisionally I find myself occaisionally having to read/write a perl script.

One of the gripes is that a language that is so good at string handling does not have a trim() function like what you find in perl. You need two lines of forgettable perl code to achieve the same result. (chomp is only good for removing the trailing newline)

comments powered by Disqus