Check output device is a terminal: Difference between revisions

Content added Content deleted
(Add Haskell)
Line 209: Line 209:


=={{header|Perl 6}}==
=={{header|Perl 6}}==
{{works with|Rakudo|2015.12}}
The .t method on a filehandle tells you whether it's going to the terminal. Here we use the note function to emit our result to standard error rather than standard out.
The .t method on a filehandle tells you whether it's going to the terminal. Here we use the note function to emit our result to standard error rather than standard out.
<pre>$ perl6 -e 'note $*OUT.t'
<pre>$ perl6 -e 'note $*OUT.t'