R
Ruby Newbee
Hello,
Please see my operation below:
irb(main):001:0> x = gets
hahase=> "hahase"
irb(main):002:0> x
=> "hahase"
irb(main):003:0> x = gets
=> nil
irb(main):004:0> x = gets
=> nil
I run x = gets then it wait me for any input.
I input "hahase" following with two "ctrl + D".
The gets finished, and it seems have got the corrent value.
But when I re-executed x = gets it always got a nil.
Why this happens? Thank you.
Regards.
Please see my operation below:
irb(main):001:0> x = gets
hahase=> "hahase"
irb(main):002:0> x
=> "hahase"
irb(main):003:0> x = gets
=> nil
irb(main):004:0> x = gets
=> nil
I run x = gets then it wait me for any input.
I input "hahase" following with two "ctrl + D".
The gets finished, and it seems have got the corrent value.
But when I re-executed x = gets it always got a nil.
Why this happens? Thank you.
Regards.