Looking at your various attempts with open statements, you're trying to do inter-process communication (IPC). Take a look at IPC::Open2 or IPC::Open3, to get back a file-handle you can read your data from, handling the various errors that might happen in a more DWIM manner than a raw "open".