Simon Schuster wrote:
> I know this could be more idiomatic to ruby.

Don't know about idiomatic, but here's my
filter-split-filter take:

  require 'open-uri'

  f = open('http://www.gutenberg.org/files/18362/18362.txt').read.
      gsub(/\s*\[.*?\]/m,'').   # strip comments
      split("\r\n").            # DOS line endings
      delete_if{ |e| e.empty? } # remove blank lines

  puts f[ rand f.size ]

Regards,
--
Bil Kleb
http://nasarb.rubyforge.org