Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's why I never write awk one-liners anymore: if I cannot get it done with cut/sed, I jump to perl right away. After all, it was designed to be AWK replacement, and has features like autosplit (-a) and line-loop (-p) [1] that specifically designed to make porting awk's programs easy. And if you need more than simple string matching, Perl still maintains huge CPAN library of modules, so JSON or Date::Parse is one command away.

(Note I still use Python/C++ for real programs; perl is only for one-liners to replace the AWK)

[0] https://news.ycombinator.com/item?id=36650120

[1] https://perldoc.perl.org/perlrun



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: