Whats wrong with:
my $str=q{DFR7234C__A_B_C_Bonzo_Dog_D_B}; $str =~ s/(?<=__)([A-Z]_)+//g;
I'd guess, pos() is localized within the code assertion. Pos() would be changeable within the while loop triggered by the regex (1st example). Maybe one of the gods may bring some light into this.
BTW, oha presented already a very nice solution here.
Regards
<mwa
In reply to Re: Can you assign to pos() in a s/foo/bar/g
by mwah
in thread Can you assign to pos() in a s/foo/bar/g
by johngg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |