in reply to Re: How to Test For Empty Piped Input
in thread How to Test For Empty Piped Input

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 $

🦛