File: menu.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 (21 lines) | stat: -rw-r--r-- 806 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
use IO::Prompt;

my $answer = prompt 'Please select the most correct answer...', -1,
                    -menu => [
                        'Perl is an interpreted language',
                        'Perl is the Swiss Army Chainsaw',
                        'Perl rocks, dude!',
                        'All of the above',
                    ];

print "You chose: [$answer]\n\n";

   $answer = prompt 'Please select the most correct answer...', -1,
                    -menu => {
                        interpreted => 'Perl is an interpreted language',
                        Swiss       => 'Perl is the Swiss Army Chainsaw',
                        Rocks       => 'Perl rocks, dude!',
                        all         => 'All of the above',
                    };

print "You chose: [$answer]\n\n";