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