if( ( ${"MetaTag_$j"} !~ /description=/gi) && ( ${"MetaTag_$j"} =~ /posted=/gi )) { ... } #### my @MetaTags = (.....); foreach my $tag (@MetaTags) { if(($tag !~ /description/gi) && $tag =~ /posted=/gi)) { print qq{$Summary
}; } }