in reply to A couple of problems....
# code to open ERRLOG here eval { die "There's no way around this!"; }; if ($@) { print ERRLOG "Caught: $@!\n"; }
As for the directory deletion and warning, your code will always log a successful deletion, even if it fails. Try this:
if (rmdir ($_)) { open(LOG, ">>$logfile") or warn "discarding logfile output\n"; print LOG "Directory: $_ - has been deleted.\n"; close (LOG) or warn "Can't close: $!"; } else { warn "Cannot delete directory: $_ ($!)"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: A couple of problems....
by djw (Vicar) on Oct 19, 2000 at 00:28 UTC |