- or download this
use Text::Abbrev;
use strict;
...
else {
print "$action was ambiguous.\n";
}
- or download this
if ("hsbn" =~ /^$action/) {
# $action is "h", "hs", "hsb", or "hsbn"
}
- or download this
my $valid = join "\n", qw( hsbn admin help quit ... );
chomp(my $action = <STDIN>);
...
else {
print "You selected $matches[0].\n";
}