in reply to Need advice in for perl use as awk replacement

> need for pŁerl came form a quite complex bash script which needs also some data mangling

good reason :) - this is generally my arc since I actually prefer using shell scripts for most simple things.

As tempting as it is, I would not try to use perl like awk. Doing this in a more readable and expanded way will greatly assist you in your efforts. The /x flag will allow you to even break the regex up over multiple lines and with comments. Your future self and certainly others will appreciate this. Check out perlre for this (and more).

You may also want to checkout Regexp::Common. It may have your use case; if not it's still good to study.

Replies are listed 'Best First'.
Re^2: Need advice in for perl use as awk replacement
by jdporter (Canon) on Sep 23, 2020 at 15:48 UTC
    I would not try to use perl like awk.

    Well, I do this quite frequently, but then (a) I am very fluent in Perl, and (b) I can't hardly write a line of awk without consulting the fm. (I used to be fluent in awk, but those parts of my brain have been taken over by Perl, like wasp maggots in a caterpillar.)