#!/usr/bin/env perl use strict; use warnings; die "What no STDIN?\n" if -t; print while <>; #### $ ./stdintest.pl What no STDIN? $ echo foo | ./stdintest.pl foo $