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! Code:
system("java", "-Djava.awt.headless=true DrawPie '40-50' 11 '50-60' 12 '20-24' 1 'Others' 10"); Code:
exec("java -Djava.awt.headless=true DrawPie '40-50' 11 '50-60' 12 '20-24' 1 'Others' 10"); thanks -m- |
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 01:44 AM. |