Skip to content

Scoping on $_ var is wrong #2026

Closed
alex opened this Issue Nov 18, 2012 · 2 comments

2 participants

@alex
alex commented Nov 18, 2012
Alexs-MacBook-Pro-2:tmp alex_gaynor$ cat t.rb 
def f
    File.open('t.rb').gets
    puts $_
end

puts $_
f
puts $_
Alexs-MacBook-Pro-2:tmp alex_gaynor$ ruby-1.9.3-p125 t.rb 

def f

Alexs-MacBook-Pro-2:tmp alex_gaynor$ rbx-head -X19 t.rb 

def f
def f

$_ should be unset once the frame its set in ends

@YorickPeterse
Rubinius member

This still occurs as of Rbx 2.5.1

@YorickPeterse
Rubinius member

Closing this one in favour of #2711.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.