in reply to running an interactive only program using perl

dpending on the program behavior, you might just be able to do this in the shell, too by either piping the content (stuff to type) or redirects.
cat /tmp/stuff.txt | yourprog yourprog < /tmp/stuff.txt # if it's just the filename you need (if not, can always use <c>echo - +e</c> to print \n newlines): echo filename.ext | yourprog # loop (bash syntax) over all your files and process them: for f in *.dat ; do echo $f | yourprog ; done