- or download this
sub ksh_select(&@) {
my $cr = shift;
...
$cr->( $_ );
}
}
- or download this
ksh_select { print "You chose $_\n" } qw( foo bar quux );
- or download this
# in this example, the user has choices to navigate around some struct
+ure.
my %dispatch = (
...
? $dispatch{$menu[$_]}->()
: warn "Selection out of range!\n";
} @menu;