T
tgwaltz
Hello -
I'm new to perl and am having a tough time trying to complete a
theoretically simple statement. What I'm trying to do is write a very
simple search engine that searches an html file for a given
searchQuery. The way it's set up now is that if the searchQuery is
something like "java," every single page is a hit because the word
"javascript" is in the code in the form of the "<script
language="javascript">" etc. I want to specify that $searchQuery
should be surrounded like so:
">(anything)searchQuery(anything)<"
In other words, the searchQuery has to be in between two HTML tags.
Here's what I have at this point (the wrong way):
return unless ($fileName =~ /\Q$searchQuery\E/i);
Any help would be greatly appreciated!
Thanks,
TW
I'm new to perl and am having a tough time trying to complete a
theoretically simple statement. What I'm trying to do is write a very
simple search engine that searches an html file for a given
searchQuery. The way it's set up now is that if the searchQuery is
something like "java," every single page is a hit because the word
"javascript" is in the code in the form of the "<script
language="javascript">" etc. I want to specify that $searchQuery
should be surrounded like so:
">(anything)searchQuery(anything)<"
In other words, the searchQuery has to be in between two HTML tags.
Here's what I have at this point (the wrong way):
return unless ($fileName =~ /\Q$searchQuery\E/i);
Any help would be greatly appreciated!
Thanks,
TW