Multiple gsub statements in one line possible?

Joe- Good point. I guess I don’t need an in-place gsub (!)



References: 81081 </cgi-bin/scat.rb/ruby/ruby-talk/81081>
Forgive me for stating the obvious… Do you have to do in-place gsub? Can
you get away with this?:

pkg_bug_base = pkg_bug_base.gsub(/<sp_num>/,
sp_num_string).gsub(/<rel_num>/, rel_num)

“Kurt Euler” wrote in message


For the string called pkg_bug_base, I’m currently using the following code
to make some substitutions:

pkg_bug_base.gsub!(/<sp_num>/, sp_num_string)
pkg_bug_base.gsub!(/<rel_num>/, rel_num)

Question: Is there a way to put this all on one line? I tried this, but
the code crashed here:

pkg_bug_base.gsub!(/<sp_num>/, sp_num_string).gsub!(/<rel_num>/,


Date: Thu, 4 Sep 2003 15:04:58 +0900