!perl script help! period turning to backslash

software development


Hi, I have a simple problem:

Im writting a perl script which runs a java applet, one of the problems im having is that the dreamhost addresses include a period …
for example /home/user/webaddress.com/stuff/
when I try to run the script it turns the “.” into a “/” like so: /home/user/webaddress/com/stuff
so it can’t find the file … how can I make it keep the period? …

heres a version of the script below:

#! /usr/bin/perl
system (java /home/user/webaddress.com/myapplet/anapplet );

anybody have an idea? Please help me !!! Thank you !


First off, applets are GUIs. You can’t run GUIs on the remove command line.

Second off, that’s because the first argument to any java command line is the class name. ClassNames change are stored via dot notation mapped to directories. Class.SubClass will be in Class/SubClass.java.

What you want is:
java --classpath=/home/user/webaddress.com/myapplet anapplet

Note, you set the classpath to the directory your file is in. Then you specify the main class name as the first argument. All additional arguments will be passes as parameters to your main() method.

yerba# rm -rf /etc


Thank you so much guice ! You saved me much head to table banging !!

I had tried the -classpath flag before but I had goofed it somehow and given up on that… Anyway now its working! yay!.. altough to clarify for anybody else who is having the same problem… the actual line of code that works is :

system ( " java -classpath /home/user/webadress.com/appletfolder anapplet");

Again thanks guice you rulez !!!