This snippet below isn't parsing meta tags the way it should. This is using LWP::Simple and the source code (which works) is in $content.
This needs to match ANY meta tag in the format shown in the script, and yes I know I shouldn't do it this way but that's the question isn't on using a different module, it's how to fix this problem. Problem is, meta tags aren't always on the same line, they can all be bunched together like a paragraph and that's where this must be messing up.
Nothing prints at all, when I use an array that's split on /n it doesn't work because not all meta tags are separated by new lines.
Where is the error in this, anyone know?
my @meta_results;
my $count = 0;
my @lines = split /\n/, $content;
while(<$content>)
{
if (/<meta name=\"(.+?)\" content=\"(.+?)\">/gi)
{
$count++;
$meta_results[$count] = "$1::$2";
}
}
foreach (@meta_results) {print "$_\n";}