my $dir = "directory"; # this dir exists my $no_dir = "no.such.directory"; # this one does not print "$dir exists" if ( -e $dir ); print "$dir is a directory" if ( -d $dir ); print "$no_dir exists" if ( -e $no_dir ); print "$no_dir is a directory" if ( -d $no_dir ); #### use File::Path; rmtree( [$name], 0, 0 );