Tested now (although not on MSWin32). Works as intended and doesn't even need the BEGIN block.
#!/usr/bin/env perl use strict; use warnings; die "What no STDIN?\n" if -t; print while <>;
Runs like this:
$ ./stdintest.pl What no STDIN? $ echo foo | ./stdintest.pl foo $
🦛
In reply to Re^2: How to Test For Empty Piped Input
by hippo
in thread How to Test For Empty Piped Input
by roho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |