From: Dave Burt Date: 2004-05-20T19:33:51+09:00 Subject: Re: How to duck type? - the psychology of static typing in Ruby Kind of like this? > ruby -e "not 'a'" -e:1: warning: string literal in condition "Rando Christensen" wrote in message news:20040519102333.6105c047@jenova.lol... > On Thu, 20 May 2004 00:59:22 +0900 > Ben Giddings wrote: > > > One of the few things that Perl still has that Ruby doesn't is this: > > > > use strict; > > > > $num = 3; > > $num += 2; > > if ($numb != 5) { > > print "Foo!!\n"; > > } > > % perl perl.pl > > Global symbol "$num" requires explicit package name at perl.pl line 3. > > Global symbol "$num" requires explicit package name at perl.pl line 4. > > Global symbol "$numb" requires explicit package name at perl.pl line > > 5. Execution of perl.pl aborted due to compilation errors. > > A better example is that perl does exactly what you were asking for > otherwise (behavior when -c and -v are both supplied to the ruby > interpreter): > > jenova ~ % cat -n what.pl > 1 $num = 3; > 2 $num += 2; > 3 if ($numb != 5) { > 4 print "Foo!!\n"; > 5 } > jenova ~ % perl -cw what.pl > Name "main::numb" used only once: possible typo at what.pl line 3. > what.pl syntax OK > jenova ~ % > > -c catches compile issues, and -w adds in warning text. > >