+1  A: 

If "run directly on the stream" means "accept connections from a remote device instead of the PHP server" then IO::Socket is a way to go. Google has plenty of examples and you can also check out perlipc documentation.

Denys
If you are able to modify the server app, then you could try calling a Perl script from within PHP as described in http://devzone.zend.com/article/1712.Another approach could be passing the data to your Perl script via a pipe, another socket, a database, etc. BTW, in your existing chain of transformations you can probably do without blah_tmp.txt unless you _need_ to save it.
Denys
awesome.....thanks for the info. I'll give those a try as soon as I get a chance...