- or download this
$_ = 'abxy' x 12;
for(my $i = 0; m/ab/g and $i++<5;) {
substr($_, $-[0], $+[0]-$-[0]) = 'abXab';
}
print;
- or download this
$_ = 'abxy' x 12;
for(my $i = 0; m/ab/g and $i++<5;) {
...
pos = $-[0]+5;
}
print;
- or download this
my $length = length(substr($_, 2, 2) = 'abXab');
print $length;