in reply to A couple of problems....

If you've ever used exception handling in another language, it's not too unfamiliar in Perl. You can use eval to catch an exception thrown with die:
# 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
    I like it.

    Thank you very much. I'll have to ++ you tomorrow.

    Thanks,
    djw