in reply to Run another script

You should have the Perl daemon write the files to some sort of spool directory (don't forget, write in a tmp location, then mv it to the spool directory so it is atomic).

You should have another daemon watch this directory, then react accordingly when a file is detected. Ideally, this daemon should be written as a shell script. When a file is detected, you can handle it however you wish - this includes calling a PHP script...or doing anything else that is possible in a shell script.

I've actually written such a monitor daemon, and if you /msg me I'll send you the link to it. I think it'll suit your purpose well.

It is paired with a Perl utility that I wrote to extract data from "message files", which really just consists of ARG="value .." pairs.