Hello All,
 
I'm working w/ the File::Find module for the first time and I'm having
problems w/ my else statement..  If the query does not match the first file
in the directory, it will print the else statement.  I would like it the if
statement to continue on to the next file in the directory to see if that
matches and if so, print the if statement   
 
I'm beginning to think I might have to use a foreach statement.....  I'm
just not sure if I can do that w/ the &wanted ..?
 
#!/usr/bin/perl -w
 
use strict;
use File::Find;
use CGI qw(:standard);
my $query = param("query");
my $search_results = "  <http://www,company.com/msds/>
http://www,company.com/msds/";;
my $no_search_results = "  <http://www.compay.com/no_msds.htm>
http:/www.compay.com/no_msds.htm";
 

undef $/;
 
find(\&wanted, '/var/www/html/msds');
 
sub wanted {
 
 return if($_ =~ /^\./);
 stat $File::Find::name;
 
  
 if ( m/$query/i ) {
 print "Location: $search_results$_\n\n";
} else {
print "Location: $no_search_results\n\n";
 }
}
 
Thanks!
 
Brian Volk
HP Products
317.298.9950 x1245
 <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
 

Reply via email to