D
David
Hi everybody,
I'm trying to do a small perl sript to compile a basic java code.
This is what I've done so far. the name of Java code is "hello.java",
and the name of the perl script is "compile". This is how I run it
:compile Hello.java
There are 2 steps, the first one is to create the hello.class which is
normally done, by writing javac hello.java.
the script is :
'javac $argv[0]';
The second step is to do java hello, using the Hello.class created,
and this what I did in my script to do that :
opendir (DH, "."); # open the local directory
foreach $file (@list) {
if ($file =~ /class$/) {
$trouve = $file;
last;} # search the Hello. class.
}
@test = split(/.class/,$trouve,2); # separate Hello from Hello.class
and run it
'java $test[0]'; #this line of code is supposed to do the step 2 but
it doesn't work.
any idea is welcomed.
Cheers;
David
I'm trying to do a small perl sript to compile a basic java code.
This is what I've done so far. the name of Java code is "hello.java",
and the name of the perl script is "compile". This is how I run it
:compile Hello.java
There are 2 steps, the first one is to create the hello.class which is
normally done, by writing javac hello.java.
the script is :
'javac $argv[0]';
The second step is to do java hello, using the Hello.class created,
and this what I did in my script to do that :
opendir (DH, "."); # open the local directory
foreach $file (@list) {
if ($file =~ /class$/) {
$trouve = $file;
last;} # search the Hello. class.
}
@test = split(/.class/,$trouve,2); # separate Hello from Hello.class
and run it
'java $test[0]'; #this line of code is supposed to do the step 2 but
it doesn't work.
any idea is welcomed.
Cheers;
David