Wednesday, August 13, 2008

how to test for existance of STDIN in perl

if ( -t STDIN ) {
print "no input piped\n";
} else {
print "input piped:\n";
while (<>) {
print;
}
}

0 Comments:

Post a Comment

<< Home