Mine
public text v1 · immutable#!/usr/local/bin/perl
my %dispatch = (
one => \&one,
two => \&two,
);
print "Enter Choice :";
my $choice = <STDIN>;
chomp($choice);
my $sub = $dispatch{$choice};
if (defined($sub)) {
&$sub;
} else {
print "That choice doesnt exist\n";
}
sub one
{
print "Choice one\n";
}
sub two
{
print "Choice two\n";
}