in reply to How portable are common $! error codes?
Most of the time, it is enough to just output the error message in $! to the user, so they can figure out what's happening. If you want to find out more about the exact condition, I'd suggest you use the -X operators, e.g.
die "Can't read $_" unless -r; die "Can't write $_" unless -r; die "Can't execute $_" unless -x; die "$_ not a file" unless -f; die "$_ not a directory" unless -d; # ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How portable are common $! error codes?
by ctilmes (Vicar) on Apr 23, 2003 at 22:19 UTC |