Z
Zach Dennis
With the following code where 'f' is an file handle:
f.each_line{ |line|
header = 1 .. $.=~$^ ? true : false
body = $^ .. f.eof ? true : false }
Say body becomes true after the first \n. What is stopping header from
becoming true again on the next \n? Since it will be between 1 and the $^.
Is the flip flop op somehow storing that $^ was already reached and not to
test the condition again?
Thanks,
Zach
f.each_line{ |line|
header = 1 .. $.=~$^ ? true : false
body = $^ .. f.eof ? true : false }
Say body becomes true after the first \n. What is stopping header from
becoming true again on the next \n? Since it will be between 1 and the $^.
Is the flip flop op somehow storing that $^ was already reached and not to
test the condition again?
Thanks,
Zach