in reply to loop in C prompt window
script.pl | sh [download]
If you want to do something interactively, you could run sh as a child process using IPC::Open3 or Expect (or numerous other ways).