From: Joel VanderWerf Date: 2007-10-09T03:18:16+09:00 Subject: Re: Can I do this perl code the same in ruby? Robert Klemme wrote: > On 08.10.2007 18:29, kazaam wrote: ... >> def upstream_proxy >> if prx = ENV["http_proxy"] >> return URI.parse(prx) >> end >> return nil >> end > > You can simplify that to > > def upstream_proxy > prx = ENV["http_proxy"] and URI.parse(prx) > end Heh, the former is actually the example from webrick in the ruby distribution. (I recognized it because I happened to be hacking on it yesterday and also thought it was a little verbose.) -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407