Update: Added tests on existence and type.use strict; use warnings; my @dirs = qw ( /root /home /sbin /tmp /lost+found /not-a-dir /etc/pas +swd ); for (@dirs) { if (! -e ) { print "$_ => does not exist"; next; } if (! -d ) { print "$_ => not a directory"; next; } (opendir(my $FH, $_)) ? print "$_ => ok" : print "$_ => denied"; } __END__ $ perl -l 621211.pl /root => denied /home => ok /sbin => ok /tmp => ok /lost+found => denied /not-a-dir => does not exist /etc/passwd => not a directory
In reply to Re: Customised error messages
by andreas1234567
in thread Customised error messages
by denzil_cactus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |