por Miguel » 2005-11-11 14:05 @628
Hola Explorer 39,
No entiendo muy bien loque me comentas, crees que esta mal hecho este scrip, en el tema de revisar varias palabras:
#!/usr/local/bin/perl -w
use CGI::Carp qw( fatalsToBrowser ); ######## for debugging info in the browser
use CGI qw(:standard -debug); ######## CGI library
#use HTML::Template;
##########################################
#print "Content-type: text/html\n\n" ;
#################################
# Retrieve the form data
my $search = param("search");
########################################
#Definition of a flag witn the value False
my $found = "false";
print header();
print start_html();
print "\n<p>There were found these results for \" $search \" </p>\n<ol>\n";
####################################
# Open the file Lnotes
open (FILE, "<Lnotes.htm");
@lines =<FILE>;
close (FILE);
#count the words
$count = 0;
# Search the word in the file
foreach $line (@lines) {
if ($line =~/\Q$search\E/i) {
print $line;
$found = "true";
$count++;
print "<br>";
}
} #end of foreach
print "\n";
if ($found eq "false") {
print "No result found for $search";
}
print "<p>";
print "Total of word of $search $count";
print end_html();
Si me puedes dar alguna solucion te lo agradeceria, mucho!
Gracias,
Miguel