Doesn't do what I want
Here's another weird Perl quirk that has a potential to cause error messages in scripts which lead you into a completely wrong direction.
$ mkdir foo $ perl -le 'print open(F, "<foo");' 1
To cite Perl documentation, "Open returns nonzero upon success". Obviously, this means that Perl thinks the open() call above succeeded. However the filehandle F is useless - all it ever does is return undefs.
So I guess this means that before every call to open() you should check if the argument accidentally points to a directory, so you can give a meaningful error message. Otherwise you might read a bunch of undefs from it without noticing.


