I’m also noticing a lack of literature on Perl on the command line, I.e “perl -nae ”.
Is awk just better for this use case?
1–10 of 37 posts
I’m also noticing a lack of literature on Perl on the command line, I.e “perl -nae ”.
Is awk just better for this use case?
For perl… not sure. I learned a bit of perl in high school and never had a chance to use it, even at work where i occasionally see it being used from other people.
If you want more information about running Perl on the command line then start with https://perldoc.perl.org/perlrun (or `perldoc perlrun` in your shell)
Perl is more powerful but learning and remembering all (or a sufficiently more powerful superset of awk's capabilities) of it is going to take time. The peculiarities of its syntax is certainly not a small set.
All of awk on the other hand needs about 2 hours, if you have done some programming before.
Searching for 'perl one liners' and the related term 'perl golf' gives many articles and books:
https://www.perl.com/article/perl-one-liners-part-1/
https://www.perl.com/article/perl-one-liners-part-2/
https://catonmat.net/perl-one-liners-explained-part-one
https://catonmat.net/perl-one-liners-explained-part-two
https://catonmat.net/perl-one-liners-explained-part-three
https://catonmat.net/perl-one-liners-explained-part-four
https://catonmat.net/perl-one-liners-explained-part-five
https://catonmat.net/perl-one-liners-explained-part-six
https://catonmat.net/perl-one-liners-explained-part-seven
http://novosial.org/perl/one-liner/
https://www.oreilly.com/library/view/perl-one-liners/9781457...