applescript from within OS X perl causes an error

Hello,
I am running an applescript from within a perl via Apple’s osascript command line utility, which is nicely bundled into the perl module OSXMacPerl. Anyway, this allows me to plop a blob of applescript code right into my perl script and it is then executed on the fly. Here’s the script:

tell application "FileMaker Pro"
activate
go to window " Title Database"
do script "Automated Export"
go to window "Subjects"
do script "Automated Export"
go to window "Contributors"
do script "Automated Export" end tell (Yes there is supposed to be a whitespace in the title of the first window.)

Pretty simple. It work fine when I run the perl script from an interactive shell or from within BBEdit. However, when I run it as a cronjob, the applescript component fails. Applescript reports the following error: “Application isn’t running.” It then sits there, eating up 77% of the CPU, doing absolutely nothing at all. Filemaker is, of course, running.
Has anyone else tried cronning an applescript? cronning a perlscript containing an applescript? anything even remotely like this?
tia!
Ben

Problem solved. For everyone’s knowledge:
Perl was a non-issue. The problem was that the terminal-less cron program cannot run applescripts using osascript. One has to use the “open *” command with a pre-compiled script. It’s ugly, but it works.

For more info, see: http://forums.macnn.com/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=001670
Ben