in reply to capturing stdout from a piped open

You might take a look at IPC::Open3 / IPC::Open2, but I'd probably go for either:

Which option is more appropriate depends on what you plan to do with the encoded stream.

updated spelling and oggenc options