Hi all:

I was trying to use the module Inline::Java unsuccessfully.
The code was:
#!/usr/bin/perl

   use Inline Java => <<'END_OF_JAVA_CODE' ;
      class Pod_alu {
         public Pod_alu(){
         }

         public int add(int i, int j){
            return i + j ;
         }

         public int subtract(int i, int j){
            return i - j ;
         }
      }
   END_OF_JAVA_CODE

   my $alu = new Pod_alu() ;
   print($alu->add(9, 16) . "\n") ; # prints 25
   print($alu->subtract(9, 16) . "\n") ; # prints -7


And the problem so far seems to be the END_OF_JAVA_CODE.
As the error was:

C:\Documents and Settings\asantillan\Desktop\perl>inlinejava.pl
Can't find string terminator "END_OF_JAVA_CODE" anywhere before EOF at
C:\Docume
nts and Settings\asantillan\Desktop\perl\inlinejava.pl line 6.

I've tried something simpler as:

#!/usr/bin/perl
use strict; use warnings;
use Inline Java => <<'EOJ';
public class Hi {
        // The class body is shown in the Java Code above
}
EOJ

my $greeter = Hi->new("howdy");
print $greeter->getGreeting(), "\n"


with the same results:

C:\Documents and Settings\asantillan\Desktop\perl>inlinejava2.pl
Can't find string terminator "EOJ" anywhere before EOF at C:\Documents and
Setti
ngs\asantillan\Desktop\perl\inlinejava2.pl line 4.


Any idea what's going on?

Thank you all. Alejandro




_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to