Create a gist now

Instantly share code, notes, and snippets.

@yko / Secret
Created Nov 7, 2011

What would you like to do?
#!/usr/bin/env perl
use Term::ANSIMenu;
use strict;
use warnings;
my @menu_items = ();
my @tmp = ();
my $counter = 1;
my @available_choices =
('menu choice one', 'menu choice two', 'menu choice three');
sub handle_menu_item {
print "Handling menu item\n"
foreach my $item (@available_choices) {
@tmp = ($counter, $item, \&handle_menu_item);
push @menu_items, [@tmp];
my $menu = Term::ANSIMenu->new(
width => 40,
title => 'Choose your fate or die!',
items => \@menu_items,
prompt => 'Selection:> '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment