in reply to Calling and interacting with external executable
Can you pipe the selection to the executable?
system( qq{ echo 1\n | $program }); [download]