From: Alexey Verkhovsky Date: 2007-04-06T02:49:27+09:00 Subject: Why is local variable created in one branch of if statement available in the other? I find it hard to understand why this code prints nil instead of saying "unknown method or local variable foo": > cat hmm.rb def hmm if false foo = 'quack' else p foo end end hmm > ruby hmm.rb nil Thoughts? -- Alex Verkhovsky