Commit | Line | Data |
93e0cdbd |
1 | Copyright 1998, O'Reilly & Associates, Inc. |
2 | |
3 | This package may be copied under the same terms as Perl itself. |
4 | |
5 | Disclaimers |
6 | ----------- |
7 | This is a work in progress, and relies on bleeding-edge technology |
8 | from the network. Don't expect not to be surprised occasionally. |
9 | |
10 | Requirements |
11 | ------------ |
12 | Perl 5.005_02 (or later) must be compiled and installed as a shared library |
13 | (libperl.so). I had to use the system's malloc. This version has not |
14 | been well tested under 5.005_02, so you can expect some rough edges. |
15 | |
16 | You need JDK 1.1. On Solaris 1.1.5 works. On Linux you need 1.1.3 with |
17 | the patches from |
18 | |
19 | ftp://ftp.blackdown.org/pub/Linux/JDK/1.1.3/updates/libjava-1.1.3v2-1.tar.gz |
20 | |
21 | The get_jdk directory contains a script that will download JDK (but not |
22 | the patch file above) off of the net for you. (This presumes you've |
23 | already installed the modules mentioned in ../README.) |
24 | |
25 | You may need to ensure that all files under the ../jpl directory are writable. |
26 | install-jpl expects to be run with super-user privileges so that it can |
27 | put things in the right places. |
28 | |
29 | What the heck is JPL? |
30 | --------------------- |
31 | JPL is a hybrid (to use the polite term) language. It's basically Java |
32 | in which the methods can optionally be implemented by Perl code. A |
33 | preprocessor called "JPL::Compile" looks at your .jpl file and spits |
34 | out the appropriate .java, .c, .h, .pl, and .so files to accomplish the |
35 | desired task. Hopefully a lot of those files can go away in the future |
36 | as jpl mutates into a Perl-to-Java compiler. The long-term goal is for |
37 | jpl to be able to take a pure Perl file and spit out a java .class |
38 | file. This initial version of JPL is an attempt to begin to mesh the |
39 | semantics of Java and Perl. Some people may find it useful in its |
40 | current form, but you should know right up front that we've still got a |
41 | ways to go with it. A journey of a thousand miles continues with the |
42 | second step... |
43 | |
44 | JPL Syntax |
45 | ---------- |
46 | JPL syntax is trivial, given that you know Java and Perl. Pretend like |
47 | you're writing a native Java method, but say "perl" instead of |
48 | "native", and then instead of omitting the body of the method, put your |
49 | Perl code in double curlies. (See Sample.jpl for an example.) |
50 | |
51 | Calling back from Perl to Java is done through the JNI (Java Native |
52 | Interface). No weird transmogrifications are done by the preprocessor |
53 | to your Perl code--it's all normal Perl. The preprocessor just wraps |
54 | it up into funny subroutines you don't see unless you peek at the .pl |
55 | file it generates. |
56 | |
57 | Installation |
58 | ------------ |
59 | Run "install-jpl". You have to tell it whether you want to use the |
60 | current directory for JPL_HOME or some other directory. Everything |
61 | else should take care of itself, except that after install-jpl |
62 | writes the setvars program, you are responsible to invoke it properly |
63 | before any JPL applications can be compiled under the current shell. |
64 | |
65 | sh: eval `setvars -sh` |
66 | csh: eval `setvars -csh` |
67 | perl: eval `setvars -perl`; |
68 | |
69 | More Info |
70 | --------- |
71 | |
72 | You can look at the Sample and Test directories, as well as the ../eg |
73 | directory for examples. |
74 | |
75 | Perhaps the most important bit of advice we can give you is to watch |
76 | |
77 | http://perl.oreilly.com |
78 | |
79 | for further information on how to get further information. |
80 | |
81 | Have the appropriate amount of fun. |