So I'm looking for feedback from those that have converted, esp. from a
hardcore Perl perspective.
Recently it dawned on me that one of the reasons I like Ruby so much is
method chaning. Why? At first, I thought it was because the program
flow went left to right, just like reading. But then it occurred to me
that being able to do something like this:
`ypcat -k amd_cise`.map { |line|
line.match(/rhost:=([^;]+)/).captures[0] rescue next
}.compact.sort.uniq.each { |server|
...
is just like using Unix pipes. When I used perl, and I needed to process
the output of a command like the above, I would generally do all the
work with a regular Unix pipeline. With ruby, the processing is very
similar already. You have to do a little more work, like catching
exceptions and things like nil elements, but the program flow is so
natural there's no need to exec the extra programs.