From: "David A. Black" Date: 2008-12-14T22:44:26+09:00 Subject: [ruby-core:20550] ruby -p behavior in 1.9 Hi -- Is this expected/correct behavior for 1.9? (Today's SVN head.) david-blacks-macbook:~ dblack$ ruby19 -pe 'gsub(/a/,"b")' a -e:1:in `
': undefined method `gsub' for main:Object (NoMethodError) david-blacks-macbook:~ dblack$ ruby19 -pe '$_.gsub(/a/,"b")' a a david-blacks-macbook:~ dblack$ ruby19 -pe '$_.gsub!(/a/,"b")' a b In other words, only gsub! with an explicit $_ has any effect. David -- David A. Black / Ruby Power and Light, LLC Ruby/Rails consulting & training: http://www.rubypal.com Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2)