Phil,

You don't need to actually put Java code in your Perl script, but you must
give Inline::Java
one of two things:

1) A list off all the classes that ypu will want to use in Perl
or
2) The name of the first class you want to use in Perl, plus tell it to
study everything else it encounters
automatically

You do this with the STUDY and AUTOSTUDY configuration options.

Here's a quick example:

   use Inline (
      Java => 'STUDY',
      STUDY => ['java.util.HashMap'],
   ) ;

   my $hm = new java::util::HashMap() ;
   $hm->put("key", "value") ;
   my $val = $hm->get("key") ;
   print($val . "\n") ; # prints value

If you add the AUTOSTUDY option, then any type that is returned by a
java.util.HashMap
method will be studied dynamically and will be accessible via Perl.

Let me know if you need more information,

Patrick
---------------------
Patrick LeBoutillier
Laval, Quebec, Canada
----- Original Message ----- 
From: "Phil Crow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 24, 2003 11:35 AM
Subject: using jars with Inline::Java


> Suppose I have a jar file with the code I want to
> access, can I use Inline::Java on it directly, or must
> I code a helper class in my perl source to reach it.
>
> If it's possible to directly access the jar, I would
> appreciate seeing a tiny example.
>
> Phil Crow
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>

Reply via email to