Expect
view release on metacpan or search on metacpan
lib/Expect.pm view on Meta::CPAN
=item $object->slave()
Returns a filehandle to the slave part of the pty. Very useful in modifying
the terminal settings:
$object->slave->stty(qw(raw -echo));
Typical values are 'sane', 'raw', and 'raw -echo'. Note that I
recommend setting the terminal to 'raw' or 'raw -echo', as this avoids
a lot of hassle and gives pipe-like (i.e. transparent) behaviour
(without the buffering issue).
=item $object->print(@strings) I<or>
=item $object->send(@strings)
Sends the given strings to the spawned command. Note that the strings
are not logged in the logfile (see print_log_file) but will probably
be echoed back by the pty, depending on pty settings (default is echo)
and thus end up there anyway. This must also be taken into account
when expect()ing for an answer: the next string will be the command
just sent. I suggest setting the pty to raw, which disables echo and
makes the pty transparently act like a bidirectional pipe.
=item $object->expect($timeout, @match_patterns)
=over 4
=item Simple interface
Given $timeout in seconds Expect will wait for $object's handle to produce
one of the match_patterns, which are matched exactly by default. If you
( run in 0.419 second using v1.01-cache-2.11-cpan-0a6323c29d9 )