Input loop: Difference between revisions
m
→{{header|Sidef}}: modified the code to work with Sidef 2.30
m (→{{header|Sidef}}: modified the code to work with Sidef 2.30) |
|||
Line 1,851:
=={{header|Sidef}}==
To read from the standard input, you can use '''STDIN''' as your '''fh'''.
<lang ruby>var file = File
file.open_r(\var fh, \var err) || die "#{file}: #{err}"
fh.each { |line| # iterates the lines of the fh
line.each_word { |word| # iterates the words of the line
say word
}
}</lang>
|