News for hackers. Stuff that matters.
Re:10 tips for writing perl one-liners by devinj on Thursday May 27, 2010 @12:34PM (#1384157)
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).
Re:10 tips for writing perl one-liners by someone_here on Thursday May 27, 2010 @01:00PM (#1384235)
It's kind of like a gateway drug once you find out about CPAN ;)
Re:10 tips for writing perl one-liners by wazoox on Thursday May 27, 2010 @05:07PM (#1384953)
It's definitely better than shell for quick file processing :) Check out this fantastic cut replacement (thanks to mjd):

  #!/usr/bin/perl
  
  my $field = shift or usage();
  $field -= 1 if $field > 0;
  
  while (<>) {
      chomp;
      my @f = split;
      print $f[$field], "\n";
  }
  
  sub usage {
      print STDERR "$0 fieldnumber\n";
      exit 1;
  }
Re:10 tips for writing perl one-liners by sreque on Thursday May 27, 2010 @01:48PM (#1384411)
No one will argue with you that Perl isn't better than awk, if that's the bar you've set for yourself for picking a new language to learn.
Re:10 tips for writing perl one-liners by zrail on Thursday May 27, 2010 @04:09PM (#1384804)
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.

[1]: http://invisible-island.net/mawk/mawk.html

Re:10 tips for writing perl one-liners by devinj on Thursday May 27, 2010 @09:28PM (#1385423)
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.