Check input device is a terminal
In this task, the job is to check whatever input filehandle comes from terminal and mention whatever input comes from it or not.
Check input device is a terminal is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.
Perl
<lang perl>use strict; use warnings; use 5.010; if (-t) {
say "Input comes from tty.";
} else {
say "Input doesn't come from tty.";
}</lang>
$ perl istty.pl Input comes from tty. $ true | perl istty.pl Input doesn't come from tty.
Perl 6
<lang perl6>say $*IN.t ?? "Input comes from tty." !! "Input doesn't come from tty.";</lang>
$ perl6 istty.p6 Input comes from tty. $ true | perl6 istty.p6 Input doesn't come from tty.