[lug] Programming

jd lug at taproot.bz
Mon Feb 24 18:53:19 MST 2003


On Mon, 2003-02-24 at 18:25, Paul Bille wrote:
> JD > "I need to write a app for windoz. I have only used perl"
> 
> Have you considered writing your app in perl, since it's your language
> of choice and serving it as a cgi-bin app like this:
> http://bille.cudenver.edu/apps/amortization/ - Ammortization Schedule
> 
> Paul
> 

That was what I wanted to do orginally. The client didnt want it.
He wanted to have running on there boxes. Otherwise, I would have
been very hip to that idea. I already have used a upload.cgi
for transfering files and it is easy. 

I decided to go with Java, for this application and my new language.
As Ed said, java is very well documented (java.sun.com/docs) and
its just like perl..well i have to decalare a few things 
and the lack of $ before vars is still hard for me to get used to ,
but look at my second "hello_world.java"...

import java.io.*;
import java.util.*;
public class JD {
 public static void main(String[] args) {
	int jd = 4;
	String  ans = "camel";
	String look = "jason";
	File my_file = new File("/home/mohadib/test.txt");
	boolean maybe = my_file.exists();
	   if(args.length < 2){
		System.out.println("Please issue 2 namesas args");
	     }
	   else{
	     	if( look.equals(args[0]) &&  ans.equals(args[1])){
		     System.out.println("if true");
		     System.out.println( look + jd);
		      if(maybe){
			 System.out.println("test.txt exist");
		      }
		      else{
			 System.out.println("test.txt is false");
		      } 
		}
		else{
		  System.out.println("if false");
		}
	}
}
}

looks just like perl..eh. Im pretty excited with java,
but Perl will always be my hero :)

#! /usr/bin/perl
$how = 1;
while($how){
        print "Perl - Oh how I love thee\n";
        print "Let me count the ways - $how\n\n";
        $how++;
        sleep 1;
}

jd








More information about the LUG mailing list