Hi, now I design another way. First I request user enter the directory want to search first, if the directory exist in the system, script will search the entire directory. If the filename is same will display out, else no result will return. If directory not exist will request user try another directory.
So, the script like below: #!/usr/bin/perl use warnings; use strict; use File::Find; find ( \&callback, "/$target"); my $target; while (1) { print "what directory want search?"; $target = <STDIN> chmod $target; if (-d $target) { print "Yes, target is a directory.\n"; next; } else{ print "No, $target not a directory.\n"; sub callback{ print $File::Find::name, "\n" if $File::Find::name =~ /File1$/; } May I know any wrong in my coding? Because I cannot run the script. Any idea about this? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>