#!/usr/bin/perl my $file; my $last = 1; while (@ARGV and $last) { last if ($ARGV[0] =~ /^\-a$/); $file = shift; die "$file\.java does not exist\!\n" unless (-e $file."\.java"); system ("javac", $file.".java"); } shift if !@ARGV; exec ("java", $file, @ARGV); #### #!/usr/bin/perl my $file; while (@ARGV and $last) { if ($ARGV[0] =~ /^\-a$/) { shift; last; } $file = shift; die "$file\.java does not exist\!\n" unless (-e $file."\.java"); $error= system("javac", $file."\.java"); } die "Compiling error, could not run!\n" if ($error); shift if !@ARGV; exec ("java", $file, @ARGV);