sub checkdir { my $directory = shift; my $is_directory=(( -e $directory ) && ( -d $directory))?0:1; $return $is_directory; }