do_something
It will then wait for input until you do CTRL+D. In the first example it will exit immediately if nothing is available in STDIN.
But doing that either involves using "select" or "IO::Select". Using either if those the solution quickly becomes quite ugly for a quite simple thing.
In reply to Re^2: Nicest way of getting STDIN a beauty contest
by mickep76
in thread Nicest way of getting STDIN a beauty contest
by mickep76
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |