my $mydir = '/mydir'; if ( -e $mydir and -d _ ) { print $mydir, ' directory exists.', $/; }