I'm having some problems iterating through a file's lines, it seems like i can only use the each_line method once per file
file = open_file(path)
file.each_line { puts "Q"}
puts "--"
file.each_line { puts "Q"}
puts "--"
file.each_line { puts "Q"}
puts "--"
file.each_line { puts "Q"}
#Output: (on a file with three lines in it )
#Q
#Q
#Q
#--
#--
#--
it works fine with a regular iterator
3.times { puts "Q"}
puts "--"
3.times { puts "Q"}
puts "--"
3.times { puts "Q"}
puts "--"
3.times { puts "Q"}
#Output: (on a file with three lines in it )
#Q
#Q
#Q
#--
#Q
#Q
#Q
#--
#Q
#Q
#Q
#--
#Q
#Q
#Q
Is there anything i'm missing