On 30/08/01 14:51 +0100, Ewan Birney wrote:
> 
> Ok, I am sure I am doing something wrong but I can't figure it out.
> 
> I can't get the Inline::Java examples to work. The error I get is
> 
> [birney@riker graphicgo]$ perl test3.pl 
> No source code in DATA section for Inline 'HASH(0x8105340)' section.

Ewan,

Well that certainly isn't the most helpful error message, but you have
made a couple of rudamentary mistakes.

First you've used curly braces where parentheses would have been more
appropriate. Inline always expects the name of a language as its first
parameter. You have in effect given Inline an anonymous hash as a first
parameter. That explains why the message says:

    ... Inline 'HASH(0x8105340)' section.

instead of:

    ... Inline 'Java' section. 

The second problem is that you've broken the basic syntax of
Inline, which is:

    use Inline <Language>, <Source Code> [,<keyword/value options>];

In other words, put the 'Bin' option after 'Java' => "source".

Cheers, Brian

> Here is my script
> 
> use Inline {
>     'Bin' => '/usr/java/jdk1.3.0_02/bin/',
> 
>     'Java' => "
>     class alu {
>       public alu { }
> 
>       public int add(int i,int j) {
>           return i+j;
>       }
> 
>     }",
> 
> };
> 
> 
>     $alu = new alu();
> 
> 
> print "Got ",$alu->add(2,2),"\n";
> 
> 
> 
> 
> 
> Inline 0.43 and Inline::Java 0.23
> 
> 
> 
> ewan
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -----------------------------------------------------------------
> Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
> <[EMAIL PROTECTED]>. 
> -----------------------------------------------------------------

Reply via email to