Hi all,

On Tue, May 15, 2012 at 4:39 AM, Sisyphus <sisyph...@optusnet.com.au> wrote:
> Hi  all,
> There's a thread on perlmonks
> ( http://www.perlmonks.org/index.pl?node_id=970385 ) in which it's claimed
> that the following code silently ignores the DIRECTORY specification, and
> (creates and) uses the ./_Inline directory:
>
> #################################
> use warnings;
> use Inline Java => "STUDY",
>          STUDY => [],
>          AUTOSTUDY => 1,
>          STARTUP_DELAY => 40,
>          PORT => 14567,
>          JNI => 1,
>          EXTRA_JAVA_ARGS => '-Xmx800m',
>          DIRECTORY => "/u/narlab/InlineLib/";
>
> use Inline::Java qw(study_classes
>                   cast
>                   caught);
>
> use Inline Java =>  <<'EOJ';
>
> public class Test {
>    public static void init() {
>       System.out.println("test");
>   }
> }
> EOJ
>
>   my $t = Test->new();
>   $t->init();
>
> #################################
>
> I assume the claim is correct (I have no reason to doubt it), but I can't
> actually verify it for myself as I no longer have a working Inline::Java
> installation.

Actually that's not exactly correct: in fact both folders are used. In
this script Inline::Java
is "use"d 3 times. The DIRECTORY is only specified at one place, so
only that instance
uses the specified DIRECTORY. Just because the first usage doesn't
actually have code
specified doesn't mean there's not some being generated behind the scenes...


If you set

use Inline Java => Config => DIRECTORY => '/home/me/here';

at the top of the script, Inline applies it to all instances.


I think this behavior is normal and I think other Inline::* modules
will behave like this
as well if you specify multiple "use"s. Can anyone confirm/deny this?


Patrick



>
> Is it right that DIRECTORY gets silently ignored like that ?
> If that's a misuse of the DIRECTORY option, should there at least be a
> warning ? (My immediate thoughts are that it should be a fatal error if
> DIRECTORY is being misused.)
>
> I'm assuming that this is the sole responsibility of Inline::Java, but
> please let me know if Inline itself is in some way at fault, or could do
> something that would improve the situation.
>
> Cheers,
> Rob



-- 
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada

Reply via email to