if (-t STDIN) { print 'opened'; } else { print 'piped or input redirection'; }
こんなんでいいのかな。 perldoc -f -t とかでみると ‐t Filehandle is opened to a tty. と書いてあって、何のことやらよくわからない。
#!perl # $Id$ use strict; use warnings; if (-t STDIN) { print 'opened'; } else { print 'piped or input redirection'; } 1;
試してみてそうなるからそういうもんなんだろうけど、なんかむねがつかえたままのような嫌な感じ。