On Mon, Jul 17, 2006, Erik Hollensbe wrote:
> At the risk of starting an argument, there are plenty of things that
> perl does (especially on the command line) that are rather powerful.
> I normally use perl where I would use awk, and this seems like a
> great application.
I agree, and me too, but you can do almost any of that in Ruby. It's
important not to lose sight of the fact that we're talking about
shelling out to a perl script, which means passing it a fairly minimal
amount of input and presumably receiving a fairly minimal amount of
output. What it might do with it internally could be very complex, but
why shell out if you don't have to?
In all likelihood Chris' perl script does some big scary stuff that he
either can't or doesn't want to convert. That's fine, it's his call.
But we should be clear that it's not likely to be a purely technical
decision.
> While his example is intentionally simple (all it does is print to
> stdout), something like this doesn't get expressed as well in ruby or
> awk:
>
> perl -ne '/(foo)(bar)/; reverse $1; print "$1$2"'
ruby -ne '$_ =~ /(foo)(bar)/; puts "#{$1.reverse}#{$2}"'
Not as clean, no, but the point is that I don't agree with your
assertion ;)
Ben
_______________________________________________
PDXRuby mailing list
[email protected]
IRC: #pdx.rb on irc.freenode.net
http://lists.pdxruby.org/mailman/listinfo/pdxruby