When you open the file without the pipe, you are opening it for editing or reading it. When you open it with a pipe, you are doing IPC (see perldoc perlipc ). It means that you are "executing the script". You can put the pipe at the front or the end of the open string. If the pipe is at the front, it means that you can write to the filehandle, and it will be sent to the programs STDIN. If the pipe is at the end of the open string, it means you can read the filehandle, which will contain the STDOUT output of the executed program. It you want to setup a program to execute, where you can manipulate BOTH the STDIN and STDERR, use IPC::Open2 (or IPC::Open3 to include STDERR).