LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-19-2004, 05:21 AM   #1
nazula
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Rep: Reputation: 0
Question 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");
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...

Code:
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-
 
Old 04-19-2004, 12:21 PM   #2
aluser
Member
 
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 42
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
perl: can I make the system function timeout? apeekaboo Programming 7 07-24-2007 07:52 AM
exec function in Linux programming geminigal Programming 5 05-06-2005 04:07 AM
Help php exec, system function for compile javac or java antony_csf Programming 0 06-15-2004 01:45 AM
what are the Hexadecimal function and ASCII function in Perl Bassam Programming 1 06-03-2004 01:44 AM
Perl system function syntax Crashed_Again Programming 2 03-20-2004 04:00 AM


All times are GMT -5. The time now is 07:25 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration