Check input device is a terminal
say $*IN.t ?? "Input comes from tty." !! "Input doesn't come from tty.";
Output:
$ perl6 istty.p6
Input comes from tty.
$ true | perl6 istty.p6
Input doesn't come from tty.
say $*IN.t ?? "Input comes from tty." !! "Input doesn't come from tty.";
$ perl6 istty.p6
Input comes from tty.
$ true | perl6 istty.p6
Input doesn't come from tty.