1Net::CLI::Interact::ActUisoenr(3C)ontributed Perl DocumeNnetta:t:iCoLnI::Interact::Action(3)
2
3
4
6 Net::CLI::Interact::Action - Sent data or matched response from
7 connected device
8
10 This class is used internally by Net::CLI::Interact and it's unlikely
11 that an end-user will need to make use of Action objects directly. The
12 interface is documented here as a matter of record.
13
14 An Action object represents either some kind of text or command to send
15 to a connected device, or a regular expression matching the response
16 from a connected device. Such Actions are built up into ActionSets
17 which describe a conversation with the connected device.
18
19 If the Action is a "send" type, then after execution it can be cloned
20 and augmented with the response text of the command. If the response is
21 likely to be paged, then the Action may also store instruction in how
22 to trigger and consume the pages.
23
25 type
26 Denotes the kind of Action, which may be "send" or "match".
27
28 value
29 In the case of "send", a String command to send to the device. In the
30 case of "match", a regular expression reference to match response from
31 the device. In special circumstances an array reference of regular
32 expression references is also valid, and each will be checked for a
33 match against the device response.
34
35 no_ors
36 Only applies to the "send" kind. Whether to skip appending the output
37 record separator (newline) to the "send" command when sent to the
38 connected device.
39
40 continuation
41 Only applies to the "send" kind. When response output is likely to be
42 paged, this stores an ActionSet that contains two Actions: one for the
43 "match" which indicates output has paused at the end of a page, and one
44 for the "send" command which triggers printing of the next page.
45
46 params
47 Only applies to the "send" kind, and contains a list of parameters
48 which are substituted into the "value" using Perl's "sprintf" function.
49 Insufficient parameters causes "sprintf" to die.
50
51 num_params
52 Only applies to the "send" kind, and returns the number of parameters
53 which are required for the current "value". Used for error checking
54 when setting "params".
55
56 response
57 A stash for the returned prompt which matched and triggered the end of
58 this action.
59
60 response_stash
61 A stash for the returned output following a "send" command, but not
62 including the matched prompt which ended the action. This slot is used
63 by the "match" action as it slurps output, but the content is then
64 transferred over to the partner "send" in the ActionSet.
65
66 prompt_hit
67 When a command is successfully issued, the response is terminated by a
68 prompt. However that prompt can be one of a list, defined in the
69 Action. This slot records the regular expression from that list which
70 was actually matched.
71
72 clone
73 Returns a new Action, which is a shallow clone of the existing one. All
74 the reference based slots will share data, but you can add (for
75 example) a "response" without affecting the original Action. Used when
76 preparing to execute an Action which has been retrieved from the
77 Phrasebook.
78
79
80
81perl v5.34.0 2021-07-22 Net::CLI::Interact::Action(3)