From: Phlip Date: 2008-07-26T23:04:11+09:00 Subject: Re: if expression or muffle an exception? aidy wrote: > I am wondering if this is bad form, > > begin > system("taskkill /im firefox.exe /f") > rescue > #preventing exception if firefox process does not exist > end > > or should I use an if expression? You can't use an if (such as if `pgrep firefox.exe` =~ /\d+/) because firefox.exe might disappear in the split second between the if and the system. That's the main difference between things you can if and things you must rescue - times when the if would have the wrong side-effects. -- Phlip