in reply to piping in & out?

Use IPC::Open2. See perlipc for more information.