in reply to trigger perl script from remote php script.

Good idea to switch from polling to an event-driven mechanism.

Following the TCP/IP path, you'll need a small daemon running on the RPi, e.g. by means of HTTP::Daemon. The triggers could be invoked from the PHP webpage by an HTTP GET or POST on specific URLs like http://<RPI-IP>/trigger/1 or http://<RPI-IP>/trigger/2. I assume, you want private access to the RPi? So, make sure, nobody else can run your scripts (e.g. HTTPS or SSH tunnel plus credentials).

If you already have a webserver running on the RPi, have a look at CGI/FCGI or even PSGI. The latter leads to Twiggy, Dancer, Mojolicious, etc. I have to add, that I have never run one of these on an RPi, so take this advice with a little bit of caution - they should work for a low traffic scenario though.