INTRODUCTION
Term::Shell -- Write command-line shells in Perl.
Term::Shell makes it joyfully easy to write command-line interfaces in Perl. All the boring details like command-line parsing and terminal handling are done for you.
package MyShell;
use base qw(Term::Shell);
# This behaves like the system echo command, minus shell expansion sub run_echo {
my $o = shift;
print "@_\n" if @_; # print the arguments
}
package main;
MyShell->new->cmdloop;
Here is a sample session from this program:
shell> help
Type 'help command' for more detailed help on a command.
This module requires Term::ReadLine to be installed. This module has been a core module since at least 5.005_03, so it shouldn't be a problem.
This module requires Text::Autoformat for some features. Text::Autoformat can be found on your nearest CPAN mirror, probably the same place you got Term::Shell.
To install Term::Shell do this:
perl Makefile.PL
make
make test
make install
(On ActivePerl for MSWin32, use nmake instead of make.)
You have to 'make install' before you can run it successfully.
Please send questions and comments to "Neil Watkiss" <NEILW@cpan.org>
Copyright (c) 2002, Neil Watkiss. All Rights Reserved.