http://www.perlmonks.org?node_id=700988


in reply to Re^2: Checking for STDIN
in thread Checking for STDIN

What do you mean?!

Save this code to a file and test it.

#!/usr/bin/perl -wl use strict; open my $fh, '>', '/tmp/test.log' or die $!; print $fh 'STDIN ', ( -t STDIN ? 'IS' : 'is NOT' ), ' available' or di +e $!; close $fh or die $!;