Ilmari Vacklin Ilmari Vacklin, 2007/06/16 23:13:

A few small issues.

Always check the return value of open(), e.g. “open … or die $!”.

Scalars do not need to be quoted when passing to subroutines. Instead of “$foo” just write $foo.

Similarly, Perl considers -a to be the string “-a”, for various legacy reasons. You can use this in calls to system(). It might be considered a bit weird by some.

my $remove = undef; # the = undef is redundant

If the string to die() has a trailing \n, the backtrace won't be printed. (See perldoc -f die.) I see now that you did actually use this once, but not in the other die()s.

Your POD doesn't have a COPYRIGHT/LICENSE section.

@ARGV[0] is a wrong. Using warnings (use warnings; or the -w flag) would inform you of this.

… if … or …; is really confusing. :)

… if …; doesn't need parentheses around the test expression.


Reinhard Tartler Reinhard Tartler, 2007/06/28 14:09:

Thank you very much for your comments!