123456789101112
my $allokay = 1;my $idx = 0;while($idx < 5 and $allokay) { $allokay &&= $line =~ /$TEXTS[$idx]/;}if($allokay) { foreach $text (@TEXTS) { $line=~ s/$text/<b>$text<\/b>/g; }}