Alejandro Santillan wrote:
> 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.
>
When you're using here docs, you need to make sure that your tag
"END_OF_JAVA_CODE" starts in column one (no spaces before it) and that
there are no spaces after the tag. Any other character on the line with
your closing tag will cause it to be ignored.
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs