#!/usr/local/bin/perl -w # print warnings use strict; use File::Find; my $Start_dir = shift; die ">$Start_dir< is not a directory\n" if !-d $Start_dir; find( \&process, $Start_dir ); sub process { return if -f $File::Find::name; # This is success - the file exist return if -e $File::Find::name; print ">$File::Find::name < is not a file or was not found\n"; } #### #!/usr/local/bin/perl -w use strict; use File::Find; my $Start_dir = shift; my @found =(); die ">$Start_dir< is not a directory\n" if ! -d $Start_dir; find(\&process, $Start_dir); sub process { push(@found, $File::Find::name) } foreach (@found){ if (-d $_ ) { print "This is success - the directory $_ exist\n"}; if ( -f $_) { print "This is success - the file $_ exist\n"}; }