> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/i/input_loop.md).

# Input loop

To read from the standard input, you can use *STDIN* as your *fh*.

```ruby
var file = 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
    }
}
```
