good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: s///g within m//g regionsby LanX (Saint) |
on Nov 09, 2021 at 13:14 UTC ( [id://11138610]=note: print w/replies, xml ) | Need Help?? |
> I could turn the string into a line-list, use the flip-flop to identify regions, and s///g for each line. That's exactly what I would do. 3 lines max. > But isn't there something cleaner and more general? I beg your pardon? Plz define "cleaner" You can certainly use some convoluted huge nested regex for this, which is hardly better maintainable. (I'm sure tybalt is already preparing one) Or an extra module with some proprietary parsing grammar. But that's only replacing one DSL with another.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|