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  -  APP::INFO::HANDLER::PROMPT (3)

.ds Aq ’

NAME

App::Info::Handler::Prompt - Prompting App::Info event handler

CONTENTS

SYNOPSIS



  use App::Info::Category::FooApp;
  use App::Info::Handler::Print;

  my $prompter = App::Info::Handler::Print->new;
  my $app = App::Info::Category::FooApp->new( on_unknown => $prompter );

  # Or...
  my $app = App::Info::Category::FooApp->new( on_confirm => prompt );



DESCRIPTION

App::Info::Handler::Prompt objects handle App::Info events by printing their messages to STDOUT and then accepting a new value from STDIN. The new value is validated by any callback supplied by the App::Info concrete subclass that triggered the event. If the value is valid, App::Info::Handler::Prompt assigns the new value to the event request. If it isn’t it prints the error message associated with the event request, and then prompts for the data again.

Although designed with unknown and confirm events in mind, App::Info::Handler::Prompt handles info and error events as well. It will simply print info event messages to STDOUT and print error event messages to STDERR. For more interesting info and error event handling, see App::Info::Handler::Print and App::Info::Handler::Carp.

Upon loading, App::Info::Handler::Print registers itself with App::Info::Handler, setting up a single string, prompt, that can be passed to an App::Info concrete subclass constructor. This string is a shortcut that tells App::Info how to create an App::Info::Handler::Print object for handling events.

INTERFACE

    Constructor

new



  my $prompter = App::Info::Handler::Prompt->new;



Constructs a new App::Info::Handler::Prompt object and returns it. No special arguments are required.

SUPPORT

This module is stored in an open GitHub repository <http://github.com/theory/app-info/>. Feel free to fork and contribute!

Please file bug reports via GitHub Issues <http://github.com/theory/app-info/issues/> or by sending mail to bug-App-Info@rt.cpan.org <mailto:bug-App-Info@rt.cpan.org>.

AUTHOR

David E. Wheeler <david@justatheory.com>

SEE ALSO

App::Info documents the event handling interface.

App::Info::Handler::Carp handles events by passing their messages Carp module functions.

App::Info::Handler::Print handles events by printing their messages to a file handle.

App::Info::Handler describes how to implement custom App::Info event handlers.

COPYRIGHT AND LICENSE

Copyright (c) 2002-2011, David E. Wheeler. Some Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

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


perl v5.20.3 APP::INFO::HANDLER::PROMPT (3) 2016-03-17

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