Term::Completion

Read one line of user input, with convenience functions
Download

Term::Completion Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Marek Rouchal
  • Publisher web site:
  • http://search.cpan.org/~marekr/

Term::Completion Tags


Term::Completion Description

Read one line of user input, with convenience functions Term::Completion is an extensible, highly configurable replacement for the venerable Term::Complete package. This module is object-oriented and thus allows subclassing. Two derived classes are Term::Completion::Multi and Term::Completion::Path. A prompt is printed and the user may enter one line of input, submitting the answer by pressing the ENTER key. This basic scenario can be implemented like this: my $answer = < STDIN >; chomp $answer; But often you don't want the user to type in the full word (from a list of choices), but allow completion, i.e. expansion of the word as far as possible by pressing as few keys as necessary. Some users like to cycle through the choices, preferably with the up/down arrow keys. And finally, you may not want the user to enter any random characters, but validate what was enter and come back if the entry did not pass the validation. If you are missing full line editing (left/right, delete to the left and right, jump to the beginning and the end etc.), you are probably wrong here, and want to consider Term::ReadLine and friends.USAGE use Term::Completion; my $tc = Term::Completion->new( prompt => "Enter your first name: ", choices => ); my $name = $tc->complete(); print "You entered: $name "; Requirements: · Perl


Term::Completion Related Software