I just went back and ++'ed your reply JO , this is a game-changer. This construct has myriad applications in general.
I'm always looking for ways to shorten code- its generally more maintainable, easier to read, and more reliable. This is a huge win to modify certain BLOCKS of text, in one statement.
Like to change all "dog"s to "canine" only in XML
pet blocks I might use:
map {/^<pets>/ .. /^<\/pets>/ ? s/dog/canine/gir : $_ } @a;
TY you made my month. I never knew how to do this ; I've tried all sorts of approaches over the years like regex assertions, etc.
++ to you for sure ; Id do ++^^10 if I could!