in reply to piped AND prompted input

#!/usr/bin/perl use strict ; use warnings ; open(CMDOPT, "find /path -type d | ") or die("$! : cant execute find") + ; while(<CMDOPT>) { print "Directory found : $_" ; ##do something with the directory here..... }
The find here can be any command. A trailing pipe '|' makes perl pipe the output of command into your script as input(with filehandle specified). A leading pipe before the command will make any output written by your Perl code to the filehandle appear as standard input to the command.

Oh!! and you can display user messages using STDOUT and accept user responses thru STDIN in the loop.....

Manav