From: David Douthitt Date: 2000-03-15T13:15:50-06:00 Subject: [ruby-talk:01856] Another question from a newbie Why does this snippet fail? class String def String.comment (str) str =~ /^(#| *$)/ end end File.open(ENV["ORACONF"]) { |conf| conf.readlines.each { |line| next if line.comment [ ... ] However, if the last line is converted to: next if String.comment(line) it works. I tried using ..... ~ /pattern/ ......... and also tried ........ self =~ /pattern/ ....... (both without a "(str)" in the definition) - but nothing works but what you see above. The "String.function(arg)" just rankles this OO-wannabe-purist :-)