Net::CLI::Interact::Role::Engine(3pm) | User Contributed Perl Documentation | Net::CLI::Interact::Role::Engine(3pm) |
Net::CLI::Interact::Role::Engine - Statement execution engine
This module is the core of Net::CLI::Interact, and serves to take entries from your loaded Phrasebooks, issue them to connected devices, and gather the returned output.
Execute a single command statement on the connected device, and consume output until there is a match with the current prompt. The statement is executed verbatim on the device, with a newline appended.
The following options are supported:
In scalar context the "last_response" is returned (see below). In list context the gathered response is returned as a list of lines. In both cases your local platform's newline character will end all lines.
Execute the commands contained within the named Macro, which must be loaded from a Phrasebook. Options to control the output, including variables for substitution into the Macro, are passed in the %options hash reference.
The following options are supported:
Values are consumed from the provided array reference and passed to the "send" commands in the Macro in order, as needed. An exception will be thrown if there are insufficient parameters.
An exception will be thrown if the Match statements in the Macro are not successful against the output returned from the device. This is based on the value of "timeout", which controls how long the module waits for matching output.
In scalar context the "last_response" is returned (see below). In list context the gathered response is returned as a list of lines. In both cases your local platform's newline character will end all lines.
Returns the gathered output after issuing the last recent "send" command within the most recent "cmd" or "prompt". That is, you get the output from the last command sent to the connected device.
In scalar context all data is returned. In list context the gathered response is returned as a list of lines. In both cases your local platform's newline character will end all lines.
Returns the complete ActionSet that was constructed from the most recent "macro" or "cmd" execution. This will be a sequence of Actions that correspond to "send" and "match" statements.
In the case of a Macro these directly relate to the contents of your Phrasebook, with the possible addition of "match" statements added automatically. In the case of a "cmd" execution, an "anonymous" Macro is constructed which consists of a single "send" and a single "match".
See the following for further interface details:
2017-11-08 | perl v5.26.1 |