Ok. Your AppleScript appears to be good, and without trying to run it myself, your Perl script appears alright as well. If I had to guess, I might say that you haven't modified the daemon code since you neglected to mention that at all.
Realize that the code you've written is disjoint without the daemon. You serve up a page with perl...and perl just so happens to write the word "open" to a file. That's all well and good, but without having your daemon actually process the "open" command, it doesn't matter if you would have written Robinson Crusoe to the file (a great book that I highly recommend by the way).
So my advice would be to add an additional case statement to the daemon if you haven't done that (remembering to restart it afterward). Otherwise, the little AppleScript you wrote will never be called.
The crucial thing to realize here is that writing the word "open" to the file doesn't automatically call open.scpt for you.
How's that work?