-
-
17 Jan 2007 01:57:53 UTC
- Distribution: Inline-Java
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (2)
- Testers (8 / 38 / 0)
- Kwalitee
Bus factor: 2- License: unknown
- Activity
24 month- Tools
- Download (92.24KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Inline
- MIME::Base64
- Test
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- NAME
- SYNOPSIS
- DESCRIPTION
- USING THE org.perl.inline.java.InlineJavaPerlInterpreter CLASS
- SEE ALSO
- AUTHOR
- COPYRIGHT
NAME
Inline::Java::PerlInterpreter - Call Perl directly from Java using Inline::Java.
SYNOPSIS
import org.perl.inline.java.* ; class HelpMePerl { static private InlineJavaPerlInterpreter pi = null ; public HelpMePerl() throws InlineJavaException { } static private boolean matches(String target, String pattern) throws InlineJavaPerlException, InlineJavaException { Boolean b = (Boolean)pi.eval("'" + target + "' =~ /" + pattern + "/", Boolean.class) ; return b.booleanValue() ; } public static void main(String args[]) throws InlineJavaPerlException, InlineJavaException { pi = InlineJavaPerlInterpreter.create() ; String target = "aaabbbccc" ; String pattern = "ab+" ; boolean ret = matches(target, pattern) ; System.out.println( target + (ret ? " matches " : " doesn't match ") + pattern) ; pi.destroy() ; } }
DESCRIPTION
WARNING:
Inline::Java::PerlInterpreter
is still experimental.The
org.perl.inline.java.InlineJavaPerlInterpreter
Java class allows you to load a Perl interpreter directly from Java. You can then perform regular callbacks to call into Perl.USING THE org.perl.inline.java.InlineJavaPerlInterpreter CLASS
Installation
Before using
org.perl.inline.java.InlineJavaPerlInterpreter
, you must have installedInline::Java
as well as the JNI extension. Additionally, the PerlInterpreter extension must also have been installed.Finding the jar
To be able to use the
org.perl.inline.java.InlineJavaPerlInterpreter
class, you must use the jar file provided byInline::Java
. You can easily locate this jar file using the following command:% perl -MInline::Java=jar
You must then add this jar file to your CLASSPATH as you would any jar file.
Basic Usage
org.perl.inline.java.InlineJavaPerlInterpreter
itself extendsorg.perl.inline.java.InlineJavaPerlCaller
. See Inline::Java::Callback for information on the callback API.Besides that API,
org.perl.inline.java.InlineJavaPerlInterpreter
provides only 2 other public methods:- public InlineJavaPerlInterpreter create() throws InlineJavaPerlException, InlineJavaException
-
Creates a new org.perl.inline.java.InlineJavaPerlInterpreter object. This class in a singleton.
- public void destroy()
-
Destroys the Perl interpreter.
SEE ALSO
Inline::Java, Inline::Java::Callback, Inline::Java::PerlNatives.
AUTHOR
Patrick LeBoutillier <patl@cpan.org> is the author of Inline::Java.
COPYRIGHT
Copyright (c) 2001-2004, Patrick LeBoutillier.
All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License. See http://www.perl.com/perl/misc/Artistic.html for more details.
Module Install Instructions
To install Inline::Java, copy and paste the appropriate command in to your terminal.
cpanm Inline::Java
perl -MCPAN -e shell install Inline::Java
For more information on module installation, please visit the detailed CPAN module installation guide.