About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

linux default iconExpect::Simple Publisher's description

A wrapper around the Expect module

Expect::Simple is a Perl wrapper around the Expect module which should suffice for simple applications. It hides most of the Expect machinery; the Expect object is available for tweaking if need be.

Generally, one starts by creating an Expect::Simple object using new. This will start up the target program, and will wait until one of the specified prompts is output by the target. At that point the caller should send() commands to the program; the results are available via the before, after, match_str, and match_idx methods. Since Expect simulates a terminal, there will be extra
characters at the end of each line in the result (on UNIX at least). This is easily fixed:

($res = $obj->before) =~ tr/
@lines = split( "
", $res );

This is not done automatically.

Exceptions will be thrown on error (match with /Expect::Simple/). Errors from Expect are available via the error_expect method. More human readable errors are available via the error method.

The connection is automatically broken (by sending the specified disconnect command to the target) when the Expect::Simple object is destroyed.


use Expect::Simple;

my $obj = new Expect::Simple
{ Cmd => [ dmcoords => 'verbose=1', "infile=$infile"],
Prompt => [ -re => 'dmcoords>:s+' ],
DisconnectCmd => 'q',
Verbose => 0,
Debug => 0,
Timeout => 100

$obj->send( $cmd );
print $obj->before;
print $obj->after;
print $obj->match_str, "
print $obj->match_idx, "
print $obj->error_expect;
print $obj->error;

$expect_object = $obj->expect_handle;

System Requirements:

В· Perl
Program Release Status:
Program Install Support: Install and Uninstall

Expect::Simple Tags:

Click on a tag to find related softwares

Is Expect::Simple your software?

Manage your software

Most Popular

linux default icon JOrg 0.93 RC
It's a software to help you control your files and their location.
linux default icon Android HTC 2.3
Android ported to the HTC Vogue, Kaiser, Polaris, and Nike.
linux default icon iReport Designer for JasperReports 4.0.2
iReport is the free, open source report designer for JasperReports.
linux default icon jGRASP 1.8.8_07 Beta
jGRASP is a lightweight development environment,.....
linux default icon Code::Blocks 10.05
A C/C++ IDE built with configurability and extensibility in mind

Related Category

» Archiving (73)
» Benchmarking (88)
» Other (3482)
» Printer (63)
» Shell Tools (113)