Remix.run Logo
jph00 9 hours ago

There’s already a language that provides all the features of awk plus modern language conveniences, and is available on every system you can think of. It’s Perl.

It even comes with an auto translator for converting awk to Perl: https://perldoc.perl.org/5.8.4/a2p

It also provides all the features of sed.

The command line flags to learn about to get all these features are: -p -i -n -l -a -e

AdieuToLogic an hour ago | parent | next [-]

> The command line flags to learn about to get all these features are: -p -i -n -l -a -e

One of my favorite Perl mnemonics when needing to apply edits to a set of files is:

  With Perl, it is as easy as pie.
Which reminds me that making a global substitution across N files can be done with:

  perl -p -i -e '<insert substitution here>' $WHAT_FILES
groby_b 8 hours ago | parent | prev [-]

Yes, but it's not in any way relevant to the topic of the article except both mentioning awk.

The author specifically wanted a functional variant of awk, and they wrote the article because it meant updating their priors on LLMs. Both are interesting topics.

I'd love to hear a Perl perspective on either

AdieuToLogic an hour ago | parent [-]

> The author specifically wanted a functional variant of awk ... I'd love to hear a Perl perspective

I believe Functional programming in Perl[0] may answer some of the questions related to using FP concepts with Perl.

0 - http://functional-perl.org/