2007-05-20から1日間の記事一覧

対話的に実行されているかどうかを調べるIO::Interactive

プログラムが対話的に実行されているかどうかで処理を分けるにはIO::Interactiveを使うと非常に楽です。 use IO::Interactive qw(is_interactive); if (is_interactive) { print {*STDOUT} q{Now, interactive}; # negotiate with human } % perl -MIO::Inte…