You might take a look at
IPC::Open3 /
IPC::Open2, but I'd probably go for either:
- using a temporary file for the output.
- setting up oggenc to read directly from /dev/dsp and output to the perl script using open OGG,"oggenc -r -C 1 /dev/dsp|" or something similar.
Which option is more appropriate depends on what you plan to do with the encoded stream.
updated spelling and oggenc options