in reply to Importing a jar file in a perl script

What exactly are you trying to do?

At the most basic level a jar file is a zip archive, that happens to contain some java class files, metadata files, and other files needed by a java program, so if you just want to extract the contents of the jar file, or parse the metadata, then you should look on CPAN for modules that can parse zip archives. Archive::Zip::MemberRead looks a likey candidate.

If your jar file contains a complete java program that you need to run, then you can start it with a system, exec open or backticks call the same as any other external program. eg:

my $cmd = 'java -jar '.$jar_file_path.' '.join(' ',@args); system $cmd;

If your jar file is a library of some sort, that your want to access from perl, then you probably want something like Inline::Java as suggested by an Anonymous Monk further up this thread, before you do that, I think you should step back, and consider what you are actualy trying to do. Could you access what the Java library is accessing via a lower level API? If you have the source of the Java library, could you port the stuff you need to perl?