Solved

Interface....

Posted on 2000-04-12
9
200 Views
Last Modified: 2010-03-05
Can java interface be built for a perl program?Can an applet  be used as front end of a perl program?If it can be used, how?
I would appreciate if someone can answer this question
0
Comment
Question by:apaazue
9 Comments
 
LVL 3

Expert Comment

by:jyu_88
ID: 2710319
just an user interface to take in user input then use those input as arguments to a perl program, and eventually return the result to the user via the Java interface/applet?
Sounds like html/CGI would be better.

supposedly you should be able to do system call with JDK2.

Lastly, since Java can interface with C or alike (as far as I know), you can at least compile your perl program into a C program...
0
 

Author Comment

by:apaazue
ID: 2712067
But how to do system callas from java program??
0
 
LVL 25

Expert Comment

by:clockwatcher
ID: 2714404
If you're talking about system calls in the normal sense, you can use the java.lang.Runtime class available since JDK 1.0.

E.g.,

public class SampleSystemCall {

  static void main(String args[]) throws java.io.IOException {
     
     Runtime.getRuntime().exec("notepad.exe");

  }
}

But as far as this question goes, to actually answer it with any kind of sense, we really need a better idea of what it is you're trying to do.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:apaazue
ID: 2716104
Am talking about UNIX environment where we get 'a.out'  files which we have to run on commandline. Will the above program work if we give the command
Runtime.getRuntime().exec("perl test.pl");
does the perl program test.pl get executed.  I tried it but it didn't work. I would appreciate if someone can help.
Thank u
0
 
LVL 6

Expert Comment

by:christopher sagayam
ID: 2717108
To make things very simple ( but not efficient)

Make a perl script like whatever.pl and DO all system calls using the PERL script

suppose the URL the PERL script is

http://www.some.com/whatever.pl


Just GET the page using JAVA interface PROCESS the output from the page and then proceed to do whatever you want


0
 

Author Comment

by:apaazue
ID: 2717170
Well! its not a web based application.  Just a program that uses perl due to its power in text manipulation. The issue is the input to the program should come from an interface preferably java.The perl scripts work fine when input is given directly to them but to make the interaction with the tool simple , i need an inetrface. Ihope it makes things much clear//
0
 
LVL 25

Accepted Solution

by:
clockwatcher earned 100 total points
ID: 2717277
0
 
LVL 25

Expert Comment

by:clockwatcher
ID: 2717293
0
 

Author Comment

by:apaazue
ID: 2717513
Thanks a lot clockwatcher, i really appreciate it.  I think its the perfect source for me to look into for what ever doubts i will get in this subject.
ThankU
/apaazue
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question