File: interactive.t

package info (click to toggle)
libio-interactive-perl 0.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 96 kB
  • ctags: 6
  • sloc: perl: 132; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 310 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use IO::Interactive qw( interactive );

print "1..2\n";

if (-t *STDIN && -t *STDOUT ) {
    print {interactive}          "ok 1\n";

    print {interactive(*STDOUT)} "ok 2\n";
}
else {
    print {interactive}          "not ";
    print "ok 1\n";

    print {interactive(*STDOUT)} "not ";
    print "ok 2\n";
}