in reply to different terminal

I am interpreting your description to mean that you are currently manually typing some commands into a terminal window to get their output, and you'd like to automate that.

Take a look at the modules IPC::System::Simple and IPC::Run3.

If you need more specific help with some code, please post the code along with a description of what it's supposed to be doing and how that's different from what it's actually doing, some sample input, the expected output, and any error messages you may be getting. See also "How do I post a question effectively?" and "I know what I mean. Why don't you?"