[Catalyst] How to execute a script

Joel Bernstein joel at fysh.org
Thu Dec 3 11:02:58 GMT 2009


2009/12/3 Ha, Tuan Trung <hatrungttha at gmail.com>:
> Hi everyone,
>
> I am new to Catalyst, and I just want to execute a script from
> Controller in Catalyst, something like this:
>
> system("perl /path/to/my/script.pl");
>
> But when I wrote this in an action, nothing happen.

You'll have to paste the exact code for us to help here, I think.

> Could anyone give an advice.

Does it work from command line? Does the script itself work?
What is the exit-status ($? >> 8) of the system()'d script?
How long does the script run for? If it's at all long-running (or
could conceivably be, e.g. under heavy system load) then you should
run it outside Catalyst, IMO, rather than pegging your response time
to the time taken for the script to execute. Anyway, barring TCP
timeouts, it's unlikely to be a Catalyst issue. Make sure the script
works standalone and work backwards from there..

/joel



More information about the Catalyst mailing list