Полезная информация

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: 8.139 Term::CompleteChapter 8
Standard Modules
Next: 8.139 Term::Complete
 

Complete

Complete ('prompt_string', array)

Sends string to the currently selected filehandle, reads the user's response, and returns the response. Takes the following arguments:

prompt_string

The prompt for user input.

array

The array of words against which the user's input is matched.

If any of the following characters are included in the user's response to prompt_string, they are treated as special characters:

TAB

Does word completion, matching what the user has typed so far against the list of strings in completion_list. On a unique match, outputs the rest of the matched string and waits for the user to press the return key. Otherwise, leaves partial input unchanged and sounds the bell.

CTRL-D

Prints all possible completions of the user's partial input, or the entire completion list if the partial input string is null, and reissues the prompt string and the partial input. Redefine by setting the variable $Term::Complete::complete.

CTRL-U

Erases any partial input. Redefine by setting the variable $Term::Complete::kill.

DEL, BS

Delete and backspace characters; both erase one character from the partial input string. Redefine by setting the variables $Term::Complete::erase1 and $Term::Complete::erase2.


Previous: 8.139 Term::CompletePerl in a NutshellNext: 8.139 Term::Complete
8.139 Term::CompleteBook Index8.139 Term::Complete