From: Gary Wright Date: 2009-03-04T01:30:35+09:00 Subject: Re: expanding environment variable On Mar 3, 2009, at 10:50 AM, Dominik Honnef wrote: >> Or: s = "$DIR/test/$FILE".gsub(/\$(\w+)/) { ENV[$1] } > Probably depends on whether you like global variables or not. It is > definitely shorter/more readable and I actually didn't know if gsub > sets $1. $1 isn't a true global variable. It is a per-thread variable. It still is a bit 'magic' for many people's tastes but it isn't as bad as a true global. Gary Wright