From: ahoward Date: 2002-10-22T09:55:31+09:00 Subject: Re: functional Ruby equiv to this perl snippet On Tue, 22 Oct 2002, Bob X wrote: > wrote in message > news:Pine.LNX.4.44.0210211942110.25814-100000@candle.superlink.net... > "or fail" won't work the way "or die" does in Perl; you need to > > rescue, because you're catching an exception (not just branching on a > > false return value). Something like: > > > > f = File.open("blah") rescue fail "That did not work" > > > Will that actually work? All the docs (pickaxe, nutshell) I have read all > show it in a begin/end statment. Is there another tome I am needing? works for me (suprised) irb(main):010:0> open 'foo123abc', 'r' rescue puts 'wow' wow nil wow. -a -- ==================================== | Ara Howard | NOAA Forecast Systems Laboratory | Information and Technology Services | Data Systems Group | R/FST 325 Broadway | Boulder, CO 80305-3328 | Email: ahoward@fsl.noaa.gov | Phone: 303-497-7238 | Fax: 303-497-7259 ====================================