Net::C...Action(3pm)
π Net::CLI::Interact::Action π
okay so bestie, welcome to the group chat. this is Net::CLI::Interact::Action(3pm) from the User Contributed Perl Documentation β and yes, the module name is literally Net::CLI::Interact::Action, we're just abbreviating it in the title because we're cute like that π
β¨ NAME β¨
Net::CLI::Interact::Action β Sent data or matched response from connected device π¦
πΈ DESCRIPTION πΈ
so like, this class is used internally by Net::CLI::Interact, and fr fr an end-user is not gonna need to mess with Action objects directly. the interface is documented here purely as a matter of record β like, for the archives, iykyk π
An Action object represents either:
- some kind of text or command to send to a connected device, or
- a regular expression matching the response from a connected device.
and the way that these Actions get built up into ActionSets which describe a whole conversation with the connected device? iconic. main character energy tbh π
if the Action is a "send" type, then after execution it can be cloned and augmented with the response text of the command. and if the response is likely to be paged, then the Action may also store instruction in how to trigger and consume the pages. so organized, we love to see it π
π INTERFACE π
π type
Denotes the kind of Action, which may be "send" or "match". two options, both slaying, no in-between β¨
π value
In the case of "send", a String command to send to the device. In the case of "match", a regular expression reference to match response from the device. In special circumstances an array reference of regular expression references is also valid, and each will be checked for a match against the device response π
π no_ors
Only applies to the "send" kind. Whether to skip appending the output record separator (newline) to the "send" command when sent to the connected device. lowkey a tiny detail, highkey important π
π continuation
Only applies to the "send" kind. When response output is likely to be paged, this stores an ActionSet that contains two Actions:
- one for the
"match"which indicates output has paused at the end of a page - one for the
"send"command which triggers printing of the next page
a lil duo, a two-piece set, we stan π«Ά
π params
Only applies to the "send" kind, and contains a list of parameters which are substituted into the "value" using Perl's sprintf function.
β οΈ Insufficient parameters causes sprintf to die. like, straight up. no cap, it's giving fatal error π
π num_params
Only applies to the "send" kind, and returns the number of parameters which are required for the current "value". Used for error checking when setting "params". she's the accountant of the operation, keeping receipts π§Ύβ¨
π response
A stash for the returned prompt which matched and triggered the end of this action π―
π response_stash
A stash for the returned output following a "send" command, but not including the matched prompt which ended the action. This slot is used by the "match" action as it slurps output, but the content is then transferred over to the partner "send" in the ActionSet. passing the baton, iconic behavior πβοΈπ¨
π prompt_hit
When a command is successfully issued, the response is terminated by a prompt. However that prompt can be one of a list, defined in the Action. This slot records the regular expression from that list which was actually matched. detective work, but make it regex π
π clone
Returns a new Action, which is a shallow clone of the existing one. All the reference based slots will share data, but you can add (for example) a "response" without affecting the original Action. Used when preparing to execute an Action which has been retrieved from the Phrasebook πβ¨
okay that's the whole vibe, bestie β every slot, every caveat, every little internal-only warning, all accounted for π
this page came to you courtesy of perl v5.36.0, dated 2023-10-28 β mwah, tysm for reading, now go talk to your devices πβ¨π¦
π¦ where this page comes from
- debian trixie: libnet-cli-interact-perl 2.400002-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-cli-interact-perl 2.400002-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-cli-interact-perl 2.400002-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-cli-interact-perl 2.400002-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms