You have several problems with your post:
I can see a number of problems with your code. I'll document the first two that leapt out at me. Fix these and, if you still need further help, please address all the points I've raised above (see "How do I post a question effectively?" if you need more help with this).
Problem 1:
my $string = quotemeta @TAGS2;
That forces a scalar context which will give you the number of elements in the array, e.g.
$ perl -wE 'my @x = qw{$ % ^}; my $y = quotemeta @x; say $y' 3
Perhaps you need something closer to:
$ perl -wE 'my @x = qw{$ % ^}; my @y = map { quotemeta } @x; say "@y"' \$ \% \^
Problem 2:
while ( my $text =~ m/ ( .{0,25} $string.{0,25} ) /gisx ) {
You may be confusing assignment (using =):
my $x = ...
with regex matching (using =~):
$x =~ /.../
Perhaps your code should look more like:
my $text = ... ... while ($text =~ ...
— Ken
In reply to Re: Perl Array Question, combining HTML::HeadParser and regex
by kcott
in thread Perl Array Question, combining HTML::HeadParser and regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |