I’m trying to automate input into a command line C program (which I have no control over), it takes arguments, runs some processor intensive code (read takes a minute), then prompts to fill out form like information. I’m not sure what the best way to Input into the prompts once they become available. Are there any CPAN libraries which make this easier? How should I go about this? To clarify I’m trying to wrap this program as a library. Kind of like how Git::Wrapper Wraps git.
Share
Without knowing more about the program you’re trying to automate, I’d suggest you start by looking at Expect. It’s also possible to do this with IPC::Run‘s
start,pump, andfinishfunctions, but Expect is a higher-level module. (And for a really low-level module, there’s IPC::Open3 in core.)