Hi ,
I have a file that lists various patterns that I need to search against another file.
so basically , i was thinking it would like searching a string array in another string array.
What is tbe best possible and efficient manner of such search.
Also i am having trouble with following piece of code that I was trying to implement . any suggestions that it is not working
@name is an array that contains multiple names.
I have an html document that is being stored into @find_html
through lwp HTML-TokeParser
======================================================
while(<name>){
my $name = <name>;
@find_results = grep{/ $name/} @find_html;
print "@find_results\n";
@find_results = ();
========================================
Seems like grep is not able to get values with variable $name but if I hardcode the value , I am able to grep it.
Does grep recognize variables inside this statement.
thanks
bondguy
*learning to make my way around perl *
I have a file that lists various patterns that I need to search against another file.
so basically , i was thinking it would like searching a string array in another string array.
What is tbe best possible and efficient manner of such search.
Also i am having trouble with following piece of code that I was trying to implement . any suggestions that it is not working
@name is an array that contains multiple names.
I have an html document that is being stored into @find_html
through lwp HTML-TokeParser
======================================================
while(<name>){
my $name = <name>;
@find_results = grep{/ $name/} @find_html;
print "@find_results\n";
@find_results = ();
========================================
Seems like grep is not able to get values with variable $name but if I hardcode the value , I am able to grep it.
Does grep recognize variables inside this statement.
thanks
bondguy
*learning to make my way around perl *