File: default.pl

package info (click to toggle)
libio-prompt-perl 0.997001-1%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 276 kB
  • sloc: perl: 846; makefile: 2
file content (22 lines) | stat: -rwxr-xr-x 427 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
#! /usr/bin/perl -w

# Yes/no input only, with defaults set...

use IO::Prompt;

until (prompt "yes? ", -default => "N", -YN1) {
    print "That's a 'no'\n";
}

while (0 + prompt "next: ", -d => "-1") {
    print "That's non-zero\n";
}

while (prompt "****: ", -d => "secret", -e => '*') {
    print "That's '$_'\n";
}
print "\n";

while (prompt "**** [or default]: ", -d => "secret", -e => '*') {
    print "That's '$_'\n";
}