This article is about Python<->AppleScript communication, but it applies to other scripting languages as well.
Generally you will have AppleScript to call the Perl script with a string argument (via do shell script), which is then parsed by the Perl script. The Perl script finally needs to print its result to the command line, so that AppleScript can get it.