Since substr returns an lvalue when less than four arguments are provided, you can do substitutions on portions of the string.
my $str = 'abracadabra'; substr($str, 3, 5) =~ s/a/@/g; print("$str\n"); # abr@c@d@bra
I realize this is off-topic, but it's a neat trick that's somewhat related.
In reply to Re: Applying a regex to part of a string
by ikegami
in thread Applying a regex to part of a string
by holdyourhorses
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |