in reply to Re: Search between pattern and append
in thread Search between pattern and append

Can you advice in a one liner ?
  • Comment on Re^2: Search between pattern and append

Replies are listed 'Best First'.
Re^3: Search between pattern and append
by Marshall (Canon) on Jul 13, 2018 at 18:13 UTC
    Yes, it is possible that I could devise a "one-liner", but WHY?
    I can also write code use the flip-flop operator, but WHY?
    Your situation is not the ideal case for the flip-flop.

    There is significant overhead in invoking Perl. There is no difference if the Perl program is expressed as one line or 20 lines.

    Why are you obsessed with a "one-liner" solution? This has no performance basis.

    Does my code accomplish your desired behaviour? If not, then why not?

      I am not a technical person. I can just copy and paste the one liner.
        Save my code as process.pl. Change <DATA> to just <> with a text editor. Save file. On unix, you will have to mark this file as "executable". You will have ask your colleagues for further details about how to do that.