[Catalyst] Re: System call problem
Florent Angly
florent.angly at gmail.com
Fri Dec 19 16:21:51 GMT 2008
Well, after some more fiddling and researching, I figured this problem out.
Using the modified command:
> system(@formatdb_cmd) == 0 or die("Could not run command:
> @formatdb_cmd\nReturn status: $?\nMessage: $!");
I found out that my error message is:
> No child processes
It turns out that in Catalyst, $SIG{CHLD} = 'IGNORE'. Setting $SIG{CHLD}
to 'DEFAULT' makes the system() calls return the proper status.
Problem solved...
Florent
Florent Angly wrote:
> Hi all,
>
> My Catalyst application uses an external Perl module that needs to
> call an external application using the Perl system() command. This
> Perl module works fine on its own (no error message when the external
> app is called). However, whenever used from within my Catalyst
> application thtough the Catalyst test server, the return status of the
> system() call is always -1 (failure, success is 0), even though the
> call seems to be executing just fine (valid output files are produced).
>
> This is the system call:
>> system(@formatdb_cmd) == 0 or die("Could not run command:
>> @formatdb_cmd\n$?");
> I tried to implement the system call with IPC::Run, but it just did
> the same.
>> IPC::Run::run(\@formatdb_cmd) or die "Could not run command:
>> @formatdb_cmd\n$?";
> Any idea what is going wrong? Do I need to do something in Catalyst?
> Should I just ignore the system() return status (but then I would
> miss real execution errors)?
>
> Thanks,
>
> Florent
>
More information about the Catalyst
mailing list