in reply to -z file test operator
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 2: -z file test operator
by tilly (Archbishop) on Aug 30, 2001 at 17:04 UTC | |
|
Re: Re: -z file test operator
by Anonymous Monk on Aug 30, 2001 at 17:08 UTC | |
|
Re: Re: -z file test operator
by Anonymous Monk on Aug 30, 2001 at 17:32 UTC | |
by Hofmator (Curate) on Aug 30, 2001 at 17:41 UTC |