From: Ryan Davis Date: 2007-07-10T15:55:40+09:00 Subject: Re: Beautiful Code : Pity he didn't ask here... On Jul 9, 2007, at 17:53 , James Edward Gray II wrote: >> ARGF.read.scan( %r{GET /ongoing/When/\d\d\dx/(\d\d\d\d/\d\d/\d\d/ >> [^ .]+) }) do |match| >> puts $1 >> end > > Hmm, I don't think we should slurp when we don't need too. There's > no reason to be wasteful. Actually there is plenty of reason to be wasteful: 1) We can. 2) It leads to code that reads like the above. 3) We can! 4) It is only a short hop to: puts ARGF.read.scan( %r%GET /ongoing/When/\d\d\dx/(\d\d\d\d/\d\d/ \d\d/[^ .]+) %).join("\n") 5) We can!! 6) It is our moral obligation to use our oft-idle and underused computers to their fullest. There was a 7th... but I forgot what it was.