Something like this might work:
my $parts = [ split /[^\\]`|^`/, $string ]; my $count = 0; foreach my $part (@$parts) { $count++; next if ($count %2); # only substitute on odd number array items $part =~ s/</</g; } my $new_string = join '`', @$parts;
Still seems lame, but I guess it works. Any other suggestions?
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In reply to Re: Replacing left angle bracket with HTML entity when between two backtick characters
by nysus
in thread Replacing left angle bracket with HTML entity when between two backtick characters
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |