Previn Lin wrote in post #1133420:
>
> Yes, but I just want to know whether there is more elegant way without
> writing ENV['PATH'] twice.

Well, apparently String#prepend has been a part of ruby since at least 
1.9.3

  $ ruby -ve 'p "a".prepend("b")'
  ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
  "ba"
  $

If it's not defined, you could always do this:

  class String; def prepend(o) "#{o}#{self}"; end end

It's not identical in behaviour, but it's close enough.

-- 
Posted via http://www.ruby-forum.com/.