THAT is very ELEGANT and Perlish TYVM!
I get an error with the "r" modifier but it seems to work without it? I'm on Perl 5.8.8 maybe /r isn't supported?
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] [d/l] [select] |
| [reply] [Watch: Dir/Any] [d/l] [select] |
| [reply] [Watch: Dir/Any] |
I thought I'd replied to this but I don't see it. Sadly we're on RH5.5 . Our company is VERY change-averse. Like NASA using Apollo components..
| [reply] [Watch: Dir/Any] |
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!
| [reply] [Watch: Dir/Any] [d/l] |
| [reply] [Watch: Dir/Any] |