On 4/19/05, angie ahl wrote:
> The following regex is failing strangely:
> 
>         my @tables = $content =~ m#\[table\](.*?)\[/table\]#g;
>         foreach (@tables) {
>                 my $table = $_;
>                 if ($content =~ m#$table#) {print "yes old table is 
> there!\n";}
>         }
> 
> @tables contains 2 items (correctly) but seaching for each item in
> $content does not match.
> 
> How can it find 2 matches and then claim that each of them aren't there?
> 
> Perl 5.8.6 Mac OS X 10.3.8
> 
> Thanks
> 
> bemused Angie
> 

Metachars in the results perhaps? Have you tried dumping @tables using
Data::Dumper and looking at the results?
Try using quotemeta (http://perldoc.perl.org/functions/quotemeta.html):
my $table = quotemeta;

HTH,
-- 
Offer Kaye

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to