scope issue of variable in iterator



mkhan@mkhan:~$ irb
irb(main):001:0> batman = 'robin'
=> "robin"
irb(main):002:0> [ 'cat', 'dog', 'horse', 'chicken' ].each { |batman|
puts batman }
cat
dog
horse
chicken
=> ["cat", "dog", "horse", "chicken"]
irb(main):003:0> puts "Now you might think this would say 'robin', but
it says: #{batman}"
Now you might think this would say 'robin', but it says: chicken
=> nil
irb(main):004:0>



--
Mohammad Khan | Software Engineer
Lextranet | 107 Union Wharf | Boston, MA 02109
http://www.lextranet.com
(617) 227-4469 Extension 218

Smart Tools. Smart Team. Smart Choice.




THE INFORMATION IN THIS MESSAGE IS INTENDED ONLY FOR THE PERSONAL AND
CONFIDENTIAL USE OF THE DESIGNATED RECIPIENTS NAMED ABOVE AND MAY
CONTAIN LEGALLY PRIVILEGED INFORMATION. If the reader of this message
is not the intended recipient or an agent responsible for delivering
it to the intended recipient, you are hereby notified that you have
received this document in error, and that any review, dissemination,
distribution or copying of this message is strictly prohibited. If
you have received this communication in error, please notify us
immediately by telephone at 617-227-4469 Ext. 200. Thank you.

begin:vcard
fn:Mohammad Khan
n:Khan;Mohammad
org:Legal Computer Solutions, Inc.
adr:;;107 Union Wharf;Boston;MA;02109;USA
email;internet:mkhan@xxxxxxxxxxxxx
title:Software Engineer
tel;work:(617) 227-4469 Extension 218
tel;home:(781) 598-8947
x-mozilla-html:FALSE
url:http://www.lextranet.com
version:2.1
end:vcard



Relevant Pages

  • slow establish of pop/smtp connection
    ... Marvell Semiconductor Israel Ltd ... proprietary or legally privileged information. ... If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. ...
    (SunManagers)
  • help
    ... confidentiality or privilege is waived or lost by any mistransmission. ... of this message if you are not the intended recipient. ... Any views expressed in this message are those of the individual sender, ...
    (Ubuntu)
  • Re: Password protected ZIP files and Email worms
    ... I've found that the A/V software does see the file within the ZIP archive, ... but cannot process it because it does not recognize the extension. ... Anti-Virus product which automatically notifies the perceived sender of a ... are not the intended recipient, you are hereby notified that any use, ...
    (NT-Bugtraq)
  • RH9 and sendmail...
    ... best regards ... confidential or legally privileged information intended only for the ... intended recipient, you are hereby notified that any disclosure, ... copying, distribution, or reliance upon the contents of this e-mail is ...
    (RedHat)
  • Mcintosh MCD-7007 cd player
    ... It has a scratch on the sid of ... it from putting it in and out of a Cabinet. ... and/or legally privileged information. ... If you are not the intended recipient, ...
    (rec.audio.marketplace)