HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/doc/libio-prompt-perl/examples/default.pl
#! /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";
}