From: Robert Dober Date: 2010-06-09T17:12:31+09:00 Subject: Re: newbie question On Wed, Jun 9, 2010 at 8:45 AM, lalawawa wrote: > In perl, one is able to sort of 'declare' variables by mentioning them > in 'my' statements.  Then, if you say 'use strict;', no variables that > weren't previously thus 'declared' are allowed.  This is useful in that > it catches typos that might be difficult to detect in testing. > > Does ruby have an equivalent mechanism? > Well one can say, that concerning local variables the "my" is implicit. Instance variables spring into life without "declaration". In Ruby 1.9 this gives you a warning though. HTH R. -- The best way to predict the future is to invent it. -- Alan Kay