From: Robert Cowham Date: 2003-07-26T08:23:10+09:00 Subject: Re: Add debug to help info nobu.nokada@softhome.net wrote in news:200307250950.h6P9oUxL026371 @sharui.nakada.kanuma.tochigi.jp: > Hi, > > At Fri, 25 Jul 2003 18:38:13 +0900, > Tim Kynerd wrote: >> I would also be interested to know what the $DEBUG flag does. > > It changes two behaviors. > > Reports exceptions at raised. > > $ ruby -e 'raise rescue p $!' > RuntimeError > > $ ruby -d -e 'raise rescue p $!' > Exception `RuntimeError' at -e:1 - > RuntimeError > > Exits main thread when any thread aborted by exceptions. > > $ ruby -e 'Thread.new{raise};sleep 1' > $ ruby -d -e 'Thread.new{raise};sleep 1' > Exception `RuntimeError' at -e:1 - > -e:1: unhandled exception > from -e:1:in `initialize' > from -e:1:in `new' > from -e:1 > That's interesting. Given the compatibility of Ruby with various Perl flags (-ane for example), -d for debug seems more important to me than the above behaviour (for the average person....). Just a thought (and would correspond to least surprise principle too!!) -- Robert Cowham