in reply to loop in C prompt window

Sounds like you mean "shell" when you say "C terminal". One solution would be to pipe the output of your script to a shell:
script.pl | sh

If you want to do something interactively, you could run sh as a child process using IPC::Open3 or Expect (or numerous other ways).