Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: da7a1d97d7
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 42 lines (32 sloc) 0.731 kb

Text::Abbrev - create an abbreviation table from a list.

Synopsis

use Text::Abbrev;

# You can say "y" or "n" too
my $option = abbrev(<yes no>){lc prompt "Y/N? "};
if $option {
    say "You have said {$option.titlecase}.";
}
else {
    say "Sorry, unknown option.";
}

Functions

abbrev

The only function exported by this module which will return unambigous truncations of every option in list. For example, when you will call abbrev <break brick> you will get following hash.

(
    # break
    "break" => "break",
    "brea"  => "break",
    "bre"   => "break",
    # brick
    "brick" => "brick",
    "bric"  => "brick",
    "bri"   => "brick",
)

Author

GlitchMr glitchmr@myopera.com

Something went wrong with that request. Please try again.