On Sun, Dec 4, 2011 at 08:19, Michael Fellinger <m.fellinger / gmail.com> wrote:
> On Sun, Dec 4, 2011 at 1:47 PM, Mc Ben <viertelvor12 / gmx.net> wrote:
...
>> open("test.txt","r").each do end # doesn't close file
>> FileUtils.rm "test.txt"      # will fail: Permission denied
...
> open will only close if you pass it a block directly.
>
> open('test.txt'){|file| file.each{ ... } }

So just "do end" doesn't count as a block?  Seems (at least to me)
like it should, albeit not usually a very useful one....

-Dave

-- 
LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern languages.
Where: Northern Virginia, Washington DC (near Orange Line), and remote work.
See: davearonson.com (main) * codosaur.us (code) * dare2xl.com (excellence).
Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (Aronson)