File: tty.pl

package info (click to toggle)
libio-prompt-perl 0.997004-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 228 kB
  • sloc: perl: 846; makefile: 2
file content (27 lines) | stat: -rwxr-xr-x 473 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /usr/bin/perl -w

# The -tty flag ensures that the prompt is sent to the tty, no matter what...

use IO::Prompt;

if (prompt -tty, "tty> ") {
    use Data::Dumper 'Dumper';
    warn Dumper [$_];
}

open $fh, ">/dev/null";

if (prompt -tty, $fh, "tty> ") {
    use Data::Dumper 'Dumper';
    warn Dumper [$_];
}

if (prompt "in> ") {
    use Data::Dumper 'Dumper';
    warn Dumper [$_];
}

if (prompt $fh, "in> ") {
    use Data::Dumper 'Dumper';
    warn Dumper [$_];
}