Perl GripesJuly 14, 2005Many 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)
$hash =~ s/^\s+//;
$hash =~ s/\s+$//;
Another gripe is the fact that perl does not have a readfile() or fpassthru() method, the likes of which you find in PHP. So you need quite a few more lines of code for the same result.
open(INFILE, $file);
while (
It get's worse if you care about file locking. Posted by raditha at July 14, 2005 6:59 AM
|
|



