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

Thx!

-Kurt



Date: Thu, 4 Sep 2003 15:04:58 +0900
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" <keuler / portal.com> wrote in message
news:C47CCC6238EFD4119C5200508B95A1000C1A5C1D / cup1ex1.portal.com...
> All-
>
> 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>/,
rel_num)
>
> Thanks.
>
> -ke