NAME
Term::Choose::GC - Works as Term::Choose.
VERSION
Version 1.008
SYNOPSIS
use 5.10.1;
use Term::Choose:GC qw(choose);
my $list = [ qw( one two three four five ) ];
my $choice = choose( $list ); # single choice
say $choice;
my @choices = choose( [ 1 .. 100 ], { right_justify => 1 } ); # multiple choice
say "@choices";
choose( [ 'Press ENTER to continue' ], { prompt => 0 } ); # no choice
DESCRIPTION
Choose from a list of elements.
Requires Perl Version 5.10.1 or greater.
Works as Term::Choose except the aspects mentioned in "DIFFERENCES".
EXPORT
Nothing by default.
use Term::Choose::GC qw(choose);
DIFFERENCES
UNICODE
While Term::Choose uses the Perl builtin functions length to determine the length of strings and sprintf widths to justify strings Term::Choose::GC uses Unicode::GCString::columns to determine the length of strings. To justify strings it uses its own function based on Unicode::GCString. The codeparts using Unicode::GCString::columns run in eval blocks: if the code in the eval block fails builtin length resp. substr are used instead. The reason for this procedure with eval is to make Term::Choose::GC's choose work also with non-unicode characters.
If the option length_longest is used with Term::Choose::GC, it is needed to calculate the value with the length of print columns of the strings which can be achieved by using the columns method from Unicode::GCString.
REQUIREMENTS
Additionally to the Term::Choose requirements Term::Choose::GC needs the module Unicode::GCString.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Term::Choose::GC
AUTHOR
Matthäus Kiem <cuer2s@gmail.com>
CREDITS
Based on and inspired by the choose function from Term::Clui module.
Thanks to the http://www.perl-community.de and the people form http://stackoverflow.com for the help.
LICENSE AND COPYRIGHT
Copyright 2012 Matthäus Kiem.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.