Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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";}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: meta parsing problems
by Joost (Canon) on May 23, 2004 at 21:59 UTC | |
Re: meta parsing problems
by exussum0 (Vicar) on May 23, 2004 at 20:27 UTC | |
by Anonymous Monk on May 23, 2004 at 21:09 UTC | |
Re: meta parsing problems
by Ctrl-z (Friar) on May 23, 2004 at 22:54 UTC | |
by Anonymous Monk on Oct 20, 2007 at 11:33 UTC | |
Re: meta parsing problems
by mrpeabody (Friar) on May 24, 2004 at 23:37 UTC |