From: Louis J Scoras Date: 2006-05-08T22:51:20+09:00 Subject: Re: A major ruby annoyance! It may also be worth noting two additional points: First, to be fair, the reason that perl has the *my* keyword for declaring a variable is to make it a lexically scoped variable. If you don't declare a variable with *my* and you aren't using the *strict* pragma, you get a non-lexical global package variable. Ruby defaults to lexically scoped variable anyway. When you want to do some cool magic tricks in perl you need to turn of strictures to do it. Ruby make it easy to extend classes and other advanced things in a safe way. Perl makes you mess around with its symbol table. Second, what perl buys you on one end, bites you in another. Unless you jump through a bunch of hoops and use inside-out objects all of your perl objects will probably be hashed based. Since hash keys are strings and aren't checked in the compile stage you can still shoot yourself in the foot. It will operate in exactly the same manner in ruby: $self->{'hard_to_speel_instance_variable'} # !! not caught by strict !! And actually, this turns out to be better in ruby because you can set the hash miss behaivor to whatever you want: hash = Hash.new { |k,v| fail 'You mispeeeled a key ;)' } which will catch half of your errors. I think it all boils down, as usual, to flexability vs safety. Ruby is nice because it lets you do things quickly and it requires less code. On the other hand, having a good test suite--as others have said--becomes all the more important. If not, you can always write rubylint ;-) -- Lou