in reply to Re: Is this the most elegant way to code directory lookup?
in thread Is this the most elegant way to code directory lookup?
die "Error:$!" unless (-d $srcdir && -d $destdir );
As I mentioned before, $! won't have anything useful in it at this point, so there's no reason to include it in the error message.
Why not make the error messages a little clearer.
die "$srcdir is not a valid directory\n" unless -d $srcdir; die "$destdir is not a valid directory\n" unless -d $destdir;
Update: Looks like I'm wrong.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Is this the most elegant way to code directory lookup?
by hv (Prior) on Oct 02, 2006 at 10:18 UTC |