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? | [reply] |
I am not a technical person. I can just copy and paste the one liner.
| [reply] |
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.
| [reply] |