From: Kirk Haines Date: 2004-07-09T01:21:29+09:00 Subject: Efficient way to do a simple Perl thing with Ruby I have some Perl code that does something like this: $copy =~ s{}{get($1)}gem Basically, apply a regex to a string, and for every match, call get($1) and replace the match with the return value of the get(). get() comes from LWP::Simple, and simply fetches the content at the given URL. My Ruby-fu is failing me at coming up with a relatively concise yet readable way to do this in Ruby. My implementation is, I am sure, much longer than necessary. So, anyone have any ideas? How would you do this? Kirk Haines