Skip to content
Text::Abbrev for Perl 6
Other
  1. Other 100.0%
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/Text
t
LICENSE
META6.json
README.md

README.md

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

You can’t perform that action at this time.