in reply to use a module: need version, import list and some parameters at the same time

One statement "imports" from Java, the other from Inline::Java. Unless you happen to have a reason to believe they can be combined, it's not likely.

It should be possible to add the version check in there, though.

use Inline (Java => ';', DIRECTORY => ...); use Inline::Java 0.52_90 qw( cast coerce );

I had to put an empty Java instruction which may slow down my program.

Your focus is entirely misplaced. Doing a few small things at compile-time should not have a significant impact on your program's performance.

  • Comment on Re: use a module: need version, import list and some parameters at the same time
  • Download Code

Replies are listed 'Best First'.
Re^2: use a module: need version, import list and some parameters at the same time
by ninuzzo (Novice) on Feb 23, 2011 at 13:02 UTC
    Thanks for your answer. You are right it is not a big overhead. Anyway there is a cure for that:
    BEGIN { # Make sure the directory exists before using Inline. mkdir '/tmp/_Inline'; } use Inline (Java => Config => DIRECTORY => '/tmp/_Inline'); use Inline::Java 0.52_90 qw( cast coerce );
    Quoting the Inline POD: "The special keyword 'Config' tells Inline that this is a configuration-only call. No source code will be compiled or bound to Perl"