You are testing whether a file called BADSYMS is zero sized (if (-z BADSYMS)), but trying to remove a file called BADSYMS.out. You're not quoting the filename in this line either.
Also, there's no need to fork off a shell for rm. Use Perl's builtin unlink instead.
Try this:
use strict; use warnings; if (-z 'BADSYMS.out') { unlink 'BADSYMS.out' or die 'Could not delete BADSYMS.out'; } else { print "Bad symbols contained in BADSYMS.out\n"; }
In reply to Re: -z file test operator
by tomhukins
in thread -z file test operator
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |