On Saturday, August 23, 2003, at 04:40 AM, Martin DeMello wrote: > Doug Kearns <djkea2 / mugca.its.monash.edu.au> wrote: >> On Wed, Aug 20, 2003 at 02:04:13AM +0900, Sean O'Dell wrote: >> >> <snip> >> >>> My point here is, I have yet to hear of a single person who left Ruby >>> for another scripting language. >> >> I came across someone today on the JudoScript list doing just that. If >> you're interested have a look at: >> >> http://groups.yahoo.com/group/judoscript/message/295 >> http://www.judoscript.com/ > > lines = words = chars = 0 > IO.foreach(ARGV[0]) {|line| > lines += 1 > words += line.split.length > chars += line.length > } > > puts "#{lines} #{words} #{chars}" > > Just saying :) > > martin > <quote source="http://groups.yahoo.com/group/judoscript/message/295"> Not only is the judoscript version the most terse, it's also seems to me to be the most intuitively obvious. Okay, I admit that the use of . and :: aren't as clear as 'println' or explicitly declaring the variables in the global scope, but they are "the judo way". </quote> contents = IO.readlines ARGV[0] puts [ contents.size, contents.join.split.size, contents.join.size ].join ' ' Any terser? ;-) Gennady.