I'm trying to go through each line in a HTML page, and check if it contains any of the entries within the array. If it does, then 'push' it to annother array, used later when joined back together as a string.
At the moment I have;
foreach (@html) {
foreach my $list (@avs_list) {
if (/$list/i) {
push(@avs, "$list");
}
}
}
$AVS = join(", ", @avs);
The problem I am having, is that, for example only 'word' out of 'the "word 1" array entry was found, it will push the whole thing. I want it to ONLY add that entry if the whole phrase was found
Any ideas? I've tried several things...but none seem to work
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
At the moment I have;
Code:
my @avs_list = qw("Word1" "word 2" "word 3" "word 4"); foreach (@html) {
foreach my $list (@avs_list) {
if (/$list/i) {
push(@avs, "$list");
}
}
}
$AVS = join(", ", @avs);
The problem I am having, is that, for example only 'word' out of 'the "word 1" array entry was found, it will push the whole thing. I want it to ONLY add that entry if the whole phrase was found
Any ideas? I've tried several things...but none seem to work
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!