PromptUtil.pm (Chapters 8 and 9)

The PromptUtil.pm module provides basic functionality for prompting the user for passwords and commands. A more sophisticated package of prompt utilities is the Term::Prompt module, found on CPAN.

This module exports two functions. The get_passwd() function prompts for a password, turning off echo so that the user's response is not visible. If a username and host is provided, the prompt includes this information (used when logging into a particular account on a remote host).

The prompt() function takes the text of a prompt and a default to return if the user enters no value. The user is prompted with the given prompt, and the function returns his response. As a special case, the function checks for a response ...

Get Network Programming with Perl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.