-   Programming (
-   -   Perl exec function in linux (and system-function) (

nazula 04-19-2004 05:21 AM

Perl exec function in linux (and system-function)
Can anyone tell me whats wrong in my code???

I'll try generate image with java, it works fine but I can't call that sub-program from perl... that is web-based script, so it have to call from cgi-script. If I run that script on shell, it works fine but when its called from web-page it wont work!


system("java", "-Djava.awt.headless=true DrawPie '40-50' 11 '50-60' 12 '20-24' 1 'Others' 10");
That doesn't do anything... no any errors, but not even execute my sub-program... I'll try it with exec-command too, but it makes exception... and doesn't exec java-command...


exec("java -Djava.awt.headless=true DrawPie '40-50' 11 '50-60' 12 '20-24' 1 'Others' 10");
I think that needs to call from shell, but how i can call java in shell from web-page???

thanks -m-

aluser 04-19-2004 12:21 PM

I'll bet that the java executable is not in your PATH when running under the webserver. Give a full path to java in your calls.

I'm also betting that you're not checking the return value of system(). If it returns false, it failed. You can also use $? to get the error status of the command run by system: see perldoc -f system

All times are GMT -5. The time now is 09:00 AM.