Hi All !
I’m new to Ruby so my question could look a bit… hmmm… stupied.
However I do did a search in comp.lang.ruby archieves and
found a lot of questions similar to the my one - but no definite
answer. Reading Programming Ruby also didn’t help.
I really don’t understand how one could find errors (typos) in
variable names, like in this example:
result = 1
reslt = 2 # a typo here!!!
more code …
The code above is OK for Ruby - even no warnings. I could spend
hours or even days finding out why the damn thing doesn’t work!
(given there are many thousands lines of code)
So I’d like to ask - is there really no way do somehow “declare”
local variable (like “use strict” and “my” in Perl)? If no, what’s
“The Right Way” to deal with such situations in Ruby?
Many thanks in advance,