From: james.d.masters@... Date: 2007-04-24T11:45:07+09:00 Subject: Re: exception and $! On Apr 23, 6:55 pm, Paul Rogers wrote: > the pickaxe tells me that the last exception is available in $!, but > c:\>irb > irb(main):001:0> raise "Its all bad!" > RuntimeError: Its all bad! > from (irb):1 > irb(main):002:0> puts $! > nil You may need to check for $! within the context of a begin/rescue/end block; this works: begin raise "Its all bad!" rescue puts "rescuing... #{$!}" end BTW, I'd recommend using the following instead of $! as $! is Perl- esque (i.e. esoteric): begin raise "Its all bad!" rescue => error puts "rescuing... #{error}" # or even better use error.backtrace for backtrace information end