There must be better ways than what I have thought of, but so far I haven't encountered them
Absolutely!
What I would recommend doing (since you're planning on distibuting the script along with your applescript anyway) is bundling the perl script within an Applescript saved as an "application bundle". You'll notice there's an option to save your scripts as such when you do a "Save" (on an unsaved script) or a "Save As...". The option is in the popup button to the right of "File Format:".
You could then access your perl script a couple different ways. Both ways would involve you telling your Applescript the exact path to the perl script. Here are a couple of examples:
1.) Launch "Script Editor" (obviously)
2.) Go ahead and save the script at this point (no code necessary yet)
--Give the script a name
--Select "application bundle" from the "File Format:" popup button
--If your script needs to perform actions and then stay idle put a
check mark next to "Stay Open" (not sure if you need this or not)
--Click the "Save" button
3.) Click the toolbar button named "Bundle Contents"
4.) Drag and drop your perl script onto the "Bundle Contents" window
(not into the "Scripts" folder)
5.) At this point you can use one of the following commands to
access your script from within your Applescript:
set PerlScriptPath to POSIX path of ((path to me) & "Contents:Resources:PerlScript" as string)
or
path to resource "PerlScript"
(of course you'd replace "PerlScript" with the actual name of your perl script)
This is where it can get a little bit confusing for some.
If you run the first of the two commands above from within the "Script Editor" itself you'll notice that the results that get returned look like this:
"/Applications/AppleScript/Script Editor.app/Contents/Resources/PerlScript"
This is because the "path to me" part of the script is referencing the "Script Editor" and not your script since you are running the script from within the "Script Editor" application. During the testing phase of creating a script like this I've found it's best to comment out that part of the code and temporarily (partially) hard code the path into the Applescript. In your case you already have a copy of the perl script residing in ~/bin, right? So you could do something like this:
--set PerlScriptPath to POSIX path of ((path to me) & "Contents:Resources:PerlScript" as string)
set PerlScriptPath to POSIX path of (path to home folder from user domain) & "bin/PerlScript" as string
Once you've thoroughly tested your script and you're sure it works correctly you could comment out the temporary part and uncomment the part of the script that points to the perl script that is bundled in your Applescript.
Is this making any sense so far?
If you used the second of the commands posted above you'd use something like this for testing:
--path to resource "PerlScript"
set PerlScriptPath to POSIX path of (path to home folder from user domain) & "bin/PerlScript" as string
Again uncommenting the first line and commenting out the second after you've completed your testing phase.
Let me stop here and see if I've completely confused you or if you're following me so far. Please feel free to ask me any questions you may have about doing this.
I hope the information I've provided comes across the way I'm trying to put it. It's so hard to explain some things without actually showing someone in person...