Ideally, the command-line tool(s) that you're trying to run should be able to operate without requiring user input after issuing the command line. The process should either get all the information it needs from the user via command line args, or else it should be able to get whatever it needs from a pipe or file redirection to its stdin (or environment variables, or a known config file, or...). Either way, you should be able to launch it and then just wait for it to finish, without further ado.
If you absolutely must provide a GUI to a tool that absolute does not work that way, then I'd have to second the suggestion above about Expect and IPC::Open3. Yeah, eewwww. Either that or else fix/replace the CLI tool(s) you're using so that you don't have to write something really complicated that requires constant attention and piecemeal inputs from the GUI user.