in reply to Re: How can I force a regex to interpolate a substituted block?
in thread How can I force a regex to interpolate a substituted block?

Are you reinventing templates?

no I don't think so? Please explain how one would be simpler than interpolating a scalar with ee?
  • Comment on Re^2: How can I force a regex to interpolate a substituted block?

Replies are listed 'Best First'.
Re^3: How can I force a regex to interpolate a substituted block?
by hippo (Archbishop) on Sep 17, 2024 at 15:38 UTC

    Oh, it is by no means simpler than interpolating a scalar with /ee. But it is safer. And it really becomes an advantage when you are performing hundreds of replacements in a single doc. But again, if that's not where this is going to end up, then there's no need. Hence the original question.

    Too often we see folks grab a powerful feature, deploy it all through their code and then it grows and eventually becomes a nightmare from one or more of efficiency, security or maintainability perspectives. Where relevant, it is best to head those off early on.


    🦛

      OK , I don't even know what Perl templates are , but you piqued my interest so I will study them a bit. TYVM

      Rolf's "ee" flag turned out to be very helpful. Sorta odd that two "e"s are needed, but I read another post that explained why.

      Rolf is such a treasure! I used to ask Larry and Damian quesitons he's like those two wrapped into one!