GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  IO::PROMPT::TINY (3)

.ds Aq ’

NAME

IO::Prompt::Tiny - Prompt for user input with a default option

CONTENTS

VERSION

version 0.003

SYNOPSIS



  use IO::Prompt::Tiny qw/prompt/;

  my $answer = prompt("Yes or no? (y/n)", "n");



DESCRIPTION

This is an extremely simple prompting module, based on the extremely simple prompt offered by ExtUtils::MakeMaker.In many cases, that’s all you need and this module gives it to you without all the overhead of ExtUtils::MakeMaker just to prompt for input.

It doesn’t do any validation, coloring, menus, timeouts, or any of the wild, crazy, cool stuff that other prompting modules do. It just prompts with a default. That’s it!

USAGE

The following function may be explicitly imported. No functions are imported by default.

    prompt



    my $value = prompt($message);
    my $value = prompt($message, $default);



The prompt() function displays the message as a prompt for input and returns the (chomped) response from the user, or the default if the response was empty.

If the program is not running interactively or if the PERL_MM_USE_DEFAULT environment variable is set to true, the default will be used without prompting.

If no default is provided, an empty string will be used instead.

Unlike ExtUtils::MakeMaker::prompt(), this prompt() does not use prototypes, so this will work as expected:



  my @args = ($prompt, $default);
  prompt(@args);



ENVIRONMENT

    PERL_MM_USE_DEFAULT

If set to a true value, IO::Prompt::Tiny will always return the default without waiting for user input, just like ExtUtils::MakeMaker does.

ACKNOWLEDGMENTS

The guts of this module are based on ExtUtils::MakeMaker and IO::Interactive::Tiny (which is based on IO::Interactive). Thank you to the authors of those modules.

SEE ALSO

o IO::Prompt
o IO::Prompt::Simple
o Prompt::Timeout
o Term::Prompt

SUPPORT

    Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker at <https://github.com/dagolden/IO-Prompt-Tiny/issues>. You will be notified automatically of any progress on your issue.

    Source Code

This is open source software. The code repository is available for public review and contribution under the terms of the license.

<https://github.com/dagolden/IO-Prompt-Tiny>



  git clone https://github.com/dagolden/IO-Prompt-Tiny.git



AUTHOR

David Golden <dagolden@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2012 by David Golden.

This is free software, licensed under:



  The Apache License, Version 2.0, January 2004



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 IO::PROMPT::TINY (3) 2015-03-30

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.