CTK::CLI - Command line interface
1.00
$Id: CLI.pm 58 2012-12-26 10:45:15Z minus $
my $v = $c->cli_prompt('Your name:', 'anonymous'); debug( "Your name: $v" ); my $v = $c->cli_prompt3('Your name:'); debug( "Your name: $v" ); my $v = $c->cli_select('Your select:',[qw/foo bar baz/],'bar'); debug( "Your select: $v" ); my $v = $c->cli_select3('Your select:',[qw/foo bar baz/]); debug( "Your select: $v" );
Command line interface. Prompt and select methods
* Use Term::ReadLine module. Sample: BEGIN { $ENV{TERM} = "dumb" if $^O eq "MSWin32" } use Term::ReadLine (); use Text::ParseWords qw(shellwords); my $term = new Term::ReadLine 'T01'; my $prompt = "T> "; my $OUT = $term->OUT || \*STDOUT; while ( defined ($_ = $term->readline($prompt)) ) { last if /^(quit|exit)$/; my @w = shellwords($_); if (@w) { print join(" ",@w),"\n"; $term->addhistory($_); } } print "\n";
Serz Minus (Lepenkov Sergey) http://serzik.ru <minus@mail333.com>
Copyright (C) 1998-2012 D&D Corporation. All Rights Reserved
This program is free software; you can redistribute it and/or modify it under the same terms and conditions as Perl itself.
This program is distributed under the GNU LGPL v3 (GNU Lesser General Public License version 3).
See LICENSE file
LICENSE
To install CTK, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CTK
CPAN shell
perl -MCPAN -e shell install CTK
For more information on module installation, please visit the detailed CPAN module installation guide.