|
NAMENet::CLI::Interact::Role::Engine - Statement execution engineDESCRIPTIONThis 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.INTERFACEcmd( $command_statement, \%options? )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. macro( $macro_name, \%options? )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:
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. last_responseReturns 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. last_actionsetReturns 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". COMPOSITIONSee the following for further interface details:
Visit the GSP FreeBSD Man Page Interface. |