in reply to CLI and problems

Take a look at existing wheel Term::Shell and Term::ShellKit.