Developer.apple.com: Web Services with AppleScript and Perl.
You can’t create a SOAP web service with AppleScript, but you can have it act as a SOAP web client and use Perl to create the service. So it becomes a simple matter of passing structured data between Perl and AppleScript, with the Perl service running either on the same machine or remotely. This is much nicer than firing off a new Perl process with the do shell script AppleScript extension, because the startup time is much faster and thus the latency is nearly eliminated. Also, state can be preserved without having to scribble it down to disk between invocations, such as a hard-to-marshal database connection or cached results.