Perl is dead. One-liners are unmaintainable. Everyone should write their one-off command invocations with test driven development, separation of interface and implementation, javadoc, and aspect-oriented programming.
I guess it's "in style" now to make fun of "Perl is unmaintainable" statements. Sure, it's cool and a lot of fun, until you're the one that has to maintain it and make changes to it.
I think this article has convinced me that I should learn Perl. Looks bloody useful for shell scripts, indeed ("a better awk" is the phrasing I've heard).
I use perl every day and awk almost every day. Awk is useful for commands where it forms a small part of an overall pipeline and needs to be somewhat terse, and yet fast. Gawk is actually fairly fast, mawk[1] even more so.
Well, there are languages I learn to improve my mind, and to improve my craft. As far as the mind goes, perl is nothing new (on the mind to-learn list: Haskell, OCaml, Eiffel, Erlang). Craftwise, it looks very useful.
(I remember especially liking the one from Sial.org - a lot of good Perl content on that site, the two from Cultured Perl and the FMTYEWTK on mass edits.)
19 comments
[ 3.1 ms ] story [ 34.7 ms ] threadhttp://www.catonmat.net/blog/perl-one-liners-explained-part-...
Now this legacy C++ and Java... hoo boy...
[1]: http://invisible-island.net/mawk/mawk.html
http://bufferfly.members.winisp.net/Perl_oneLiners.html
(I remember especially liking the one from Sial.org - a lot of good Perl content on that site, the two from Cultured Perl and the FMTYEWTK on mass edits.)
`..` is called flip-flop in the context describe in the post.
Goatse operator `=()=`:
Here's another usage for `\K`: Output: http://stackoverflow.com/questions/2892126/file-fix-it-codeg...Other features: http://stackoverflow.com/questions/161872/hidden-features-of...
http://petdance.com/perl/command-line-options.pdf