From: rich Date: Wed, 15 Oct 2003 16:51:12 +0000 (+0000) Subject: Wrappers now automatically 'use' modules. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=9e88eacb7d2a8883900fba0c8abedc26c7510d98;p=perl4caml.git Wrappers now automatically 'use' modules. Initialization is done automatically. --- diff --git a/.depend b/.depend index df0f9dd..b7d8bc1 100644 --- a/.depend +++ b/.depend @@ -1,7 +1,5 @@ perl.cmo: perl.cmi perl.cmx: perl.cmi -perl_init.cmo: perl.cmi -perl_init.cmx: perl.cmx examples/google.cmo: perl.cmi wrappers/pl_Net_Google.cmo examples/google.cmx: perl.cmx wrappers/pl_Net_Google.cmx examples/loadpage.cmo: perl.cmi wrappers/pl_HTML_Element.cmo \ @@ -10,8 +8,8 @@ examples/loadpage.cmo: perl.cmi wrappers/pl_HTML_Element.cmo \ examples/loadpage.cmx: perl.cmx wrappers/pl_HTML_Element.cmx \ wrappers/pl_HTML_TreeBuilder.cmx wrappers/pl_HTTP_Request.cmx \ wrappers/pl_LWP_UserAgent.cmx -examples/test.cmo: perl.cmi -examples/test.cmx: perl.cmx +examples/test.cmo: perl.cmi wrappers/pl_Net_Google.cmo +examples/test.cmx: perl.cmx wrappers/pl_Net_Google.cmx wrappers/pl_HTML_Element.cmo: perl.cmi wrappers/pl_HTML_Element.cmx: perl.cmx wrappers/pl_HTML_Parser.cmo: perl.cmi diff --git a/Makefile b/Makefile index 661564c..d09c8dc 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Interface to Perl from OCaml. # Copyright (C) 2003 Merjis Ltd. -# $Id: Makefile,v 1.9 2003-10-15 09:49:52 rich Exp $ +# $Id: Makefile,v 1.10 2003-10-15 16:51:12 rich Exp $ include Makefile.config @@ -20,6 +20,11 @@ CFLAGS := -Wall -Wno-unused -I$(PERLINCDIR) LIBPERL := $(shell perl -MExtUtils::Embed -e ldopts) +# XXX Hack required by ocamlopt, and sometimes ocamlc. +# To work out what this should be, try: +# `shell perl -MExtUtils::Embed -e ldopts' +DYNALOADER_HACK := /usr/lib/perl/5.8.1/auto/DynaLoader/DynaLoader.a + WRAPPERS := \ wrappers/pl_Net_Google_Cache.cmo \ wrappers/pl_Net_Google_Response.cmo \ @@ -35,7 +40,7 @@ WRAPPERS := \ wrappers/pl_HTTP_Response.cmo \ wrappers/pl_LWP_UserAgent.cmo -all: perl4caml.cma perl4caml.cmxa perl_init.cmo perl_init.cmx all-examples +all: perl4caml.cma perl4caml.cmxa all-examples perl4caml.cma: perl.cmo perl_c.o $(WRAPPERS) $(OCAMLMKLIB) -o perl4caml $(LIBPERL) $^ @@ -43,25 +48,26 @@ perl4caml.cma: perl.cmo perl_c.o $(WRAPPERS) perl4caml.cmxa: perl.cmx perl_c.o $(WRAPPERS:.cmo=.cmx) $(OCAMLMKLIB) -o perl4caml $(LIBPERL) $^ -all-examples: examples/test examples/loadpage examples/google +all-examples: examples/test examples/loadpage examples/google \ + examples/test.opt examples/loadpage.opt examples/google.opt examples/test: examples/test.cmo - $(OCAMLC) $(OCAMLCFLAGS) perl4caml.cma perl_init.cmo $^ -o $@ + $(OCAMLC) $(OCAMLCFLAGS) perl4caml.cma $^ -o $@ -#examples/test.opt: examples/test.cmx -# $(OCAMLOPT) $(OCAMLOPTFLAGS) perl4caml.cmxa perl_init.cmx $^ -o $@ +examples/test.opt: examples/test.cmx + $(OCAMLOPT) $(OCAMLOPTFLAGS) perl4caml.cmxa $(DYNALOADER_HACK) $^ -o $@ examples/loadpage: examples/loadpage.cmo - $(OCAMLC) $(OCAMLCFLAGS) perl4caml.cma perl_init.cmo $^ -o $@ + $(OCAMLC) $(OCAMLCFLAGS) perl4caml.cma $^ -o $@ -#examples/loadpage.opt: examples/loadpage.cmx -# $(OCAMLOPT) $(OCAMLOPTFLAGS) perl4caml.cmxa perl_init.cmx $^ -o $@ +examples/loadpage.opt: examples/loadpage.cmx + $(OCAMLOPT) $(OCAMLOPTFLAGS) perl4caml.cmxa $(DYNALOADER_HACK) $^ -o $@ examples/google: examples/google.cmo - $(OCAMLC) $(OCAMLCFLAGS) perl4caml.cma perl_init.cmo $^ -o $@ + $(OCAMLC) $(OCAMLCFLAGS) perl4caml.cma $^ -o $@ -#examples/google.opt: examples/google.cmx -# $(OCAMLOPT) $(OCAMLOPTFLAGS) perl4caml.cmxa perl_init.cmx $^ -o $@ +examples/google.opt: examples/google.cmx + $(OCAMLOPT) $(OCAMLOPTFLAGS) perl4caml.cmxa $(DYNALOADER_HACK) $^ -o $@ %.cmi: %.mli $(OCAMLC) $(OCAMLCFLAGS) -c $< @@ -98,10 +104,11 @@ depend: .depend # Install. install: + rm -rf $(OCAMLLIBDIR)/perl install -c -m 0755 -d $(OCAMLLIBDIR)/perl install -c -m 0755 -d $(OCAMLLIBDIR)/stublibs install -c -m 0644 perl.cmi perl.mli perl4caml.cma perl4caml.cmxa \ - perl_init.cmo perl_init.cmx perl4caml.a libperl4caml.a \ + perl4caml.a libperl4caml.a \ $(WRAPPERS:.cmo=.ml) $(WRAPPERS:.cmo=.cmi) $(OCAMLLIBDIR)/perl install -c -m 0644 dllperl4caml.so $(OCAMLLIBDIR)/stublibs diff --git a/examples/.cvsignore b/examples/.cvsignore index c39553a..0560bb3 100644 --- a/examples/.cvsignore +++ b/examples/.cvsignore @@ -5,4 +5,7 @@ *.cmxa test loadpage -google \ No newline at end of file +google +test.opt +loadpage.opt +google.opt \ No newline at end of file diff --git a/examples/google.ml b/examples/google.ml index 47bd8e4..2e8ca40 100644 --- a/examples/google.ml +++ b/examples/google.ml @@ -1,7 +1,7 @@ (* Example program which uses Net::Google to query Google. * You will need to have a Google API key in ~/.googlekey for this to work. * Copyright (C) 2003 Merjis Ltd. - * $Id: google.ml,v 1.1 2003-10-14 16:05:21 rich Exp $ + * $Id: google.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Printf @@ -9,9 +9,6 @@ open Printf open Pl_Net_Google let () = - (* This is a hack which shouldn't be needed in future. *) - Perl.eval "use Net::Google"; - (* Load Google API key. *) let home = Sys.getenv "HOME" in let chan = open_in (home ^ "/.googlekey") in @@ -32,3 +29,6 @@ let () = (fun response -> printf "* %s\n \n\n" response#title response#url ) search#results; + + (* Destroy the Perl interpreter. *) + Perl.destroy (Perl.current_interpreter ()) diff --git a/examples/loadpage.ml b/examples/loadpage.ml index 9f67907..4007f8d 100644 --- a/examples/loadpage.ml +++ b/examples/loadpage.ml @@ -1,7 +1,7 @@ (* Example program which uses LWP::UserAgent and HTML::TreeBuilder to * download an HTTP page and parse it. * Copyright (C) 2003 Merjis Ltd. - * $Id: loadpage.ml,v 1.2 2003-10-14 16:05:21 rich Exp $ + * $Id: loadpage.ml,v 1.3 2003-10-15 16:51:12 rich Exp $ *) open Printf @@ -12,10 +12,6 @@ open Pl_HTML_TreeBuilder open Pl_HTML_Element let () = - (* This is a hack which shouldn't be needed in future. *) - Perl.eval "use LWP::UserAgent"; - Perl.eval "use HTML::TreeBuilder"; - let site = if Array.length Sys.argv >= 2 then Sys.argv.(1) @@ -61,4 +57,4 @@ let () = print tree; (* Destroy the Perl interpreter. *) - Perl.destroy () + Perl.destroy (Perl.current_interpreter ()) diff --git a/examples/test.ml b/examples/test.ml index 8ec8c74..99bcfd4 100644 --- a/examples/test.ml +++ b/examples/test.ml @@ -1,10 +1,15 @@ (* Simple test of the API. * Copyright (C) 2003 Merjis Ltd. - * $Id: test.ml,v 1.2 2003-10-12 17:33:14 rich Exp $ + * $Id: test.ml,v 1.3 2003-10-15 16:51:12 rich Exp $ *) open Printf +(* XXX Hack to workaround some sort of linking bug in OCaml. Without this + * the Perl module isn't initialized and this code crashes. + *) +let f = Pl_Net_Google.may + let () = (* Load "test.pl". *) Perl.eval "require 'examples/test.pl'"; @@ -46,4 +51,4 @@ let () = printf "TestClass.foo is %d\n" (Perl.int_of_sv sv); flush stdout; (* Destroy the interpreter. *) - Perl.destroy () + Perl.destroy (Perl.current_interpreter ()) diff --git a/perl.ml b/perl.ml index a82755b..0f2d9fc 100644 --- a/perl.ml +++ b/perl.ml @@ -1,6 +1,6 @@ (* Interface to Perl from OCaml. * Copyright (C) 2003 Merjis Ltd. - * $Id: perl.ml,v 1.5 2003-10-14 16:05:21 rich Exp $ + * $Id: perl.ml,v 1.6 2003-10-15 16:51:12 rich Exp $ *) type t @@ -10,16 +10,29 @@ type av exception Perl_failure of string +external create : ?args:string array -> unit -> t + = "perl4caml_create" + +(* Initialization. This must happen first, otherwise other parts of the + * program will segfault because of a missing interpreter. + *) external c_init : unit -> unit = "perl4caml_init" -let init () = +let () = + (* Leave this debugging message in for now until init support in OCaml + * is debugged. + *) + prerr_endline "perl_init: Initialising Perl support ..."; Callback.register_exception "perl4caml_perl_failure" (Perl_failure ""); - c_init () (* Initialise C code. *) + c_init (); (* Initialise C code. *) + (* Create the default interpreter. *) + create ~args:[| ""; "-w"; "-e"; "0" |] (); + () -external destroy : unit -> unit - = "perl4caml_destroy" +external current_interpreter : unit -> t + = "perl4caml_current_interpreter" -external create : ?args:string array -> unit -> t - = "perl4caml_create" +external destroy : t -> unit + = "perl4caml_destroy" external set_context : t -> unit = "perl4caml_set_context" diff --git a/perl.mli b/perl.mli index 7bf89c3..6be7f38 100644 --- a/perl.mli +++ b/perl.mli @@ -2,7 +2,7 @@ * * Copyright (C) 2003 Merjis Ltd. * - * $Id: perl.mli,v 1.5 2003-10-14 16:05:21 rich Exp $ + * $Id: perl.mli,v 1.6 2003-10-15 16:51:12 rich Exp $ *) type t @@ -22,19 +22,43 @@ type hv exception Perl_failure of string (** [die] in Perl code is translated automatically into this exception. *) -val init : unit -> unit -(** Don't call this. Instead link your program with [perl_init.cmo] or - * [perl_init.cmx] which calls this for you. - *) +external current_interpreter : unit -> t + = "perl4caml_current_interpreter" +(** The [Perl] module has a notion of the "current" interpreter. Throws + * [Not_found] if there is no current interpreter. + * + * When a program starts up, if it has been linked with [perl_init.cmo] + * (which is should be), an interpreter is created for you. Normally + * this should be all you need to know about interpreters, unless you + * want to be really good and call + * [Perl.destroy (Perl.current_interpreter ())] at the end of your + * program to do proper cleanup. + * + * You can also, under certain circumstances, create other interpreters, + * although this is experiemental and definitely not recommended. + * + * If Perl was compiled with [-Dusemultiplicity] then you can create + * mutliple interpreters at the same time and switch between them by + * calling {!Perl.set_context}. + * + * Otherwise you may destroy the current interpreter and create another + * one (provided that at no time you have two "live" interpreters), + * by calling {!Perl.destroy} followed by {!Perl.create}. +*) -external destroy : unit -> unit +external destroy : t -> unit = "perl4caml_destroy" -(** Destroy the current Perl interpreter, performing any necessary cleanup. - * You should call this at the end of your program, otherwise Perl won't - * properly clean up. +(** Destroy the Perl interpreter, performing any necessary cleanup. + * + * You should call [Perl.destroy (Perl.current_interpreter ())] at + * the end of your program, otherwise Perl won't properly clean up + * (running [END] blocks, destroying objects and the like). * * Note that a Perl interpreter is created for you by default when you * use perl4caml. + * + * The current interpreter can be found by calling + * {!Perl.current_interpreter}. *) external create : ?args:string array -> unit -> t diff --git a/perl_c.c b/perl_c.c index bf78580..57cf650 100644 --- a/perl_c.c +++ b/perl_c.c @@ -1,6 +1,6 @@ /* Interface to Perl from OCaml. * Copyright (C) 2003 Merjis Ltd. - * $Id: perl_c.c,v 1.5 2003-10-14 16:05:21 rich Exp $ + * $Id: perl_c.c,v 1.6 2003-10-15 16:51:12 rich Exp $ */ #include @@ -43,31 +43,29 @@ static value unoption (value option, value deflt); #define Val_av(av) (Val_voidptr ((av))) #define Av_val(avv) (Voidptr_val (AV, (avv))) -static void -xs_init (pTHX) +CAMLprim value +perl4caml_init (value unit) { - char *file = __FILE__; - EXTERN_C void boot_DynaLoader (pTHX_ CV* cv); - - newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); + CAMLparam1 (unit); + PERL_SYS_INIT3 (NULL, NULL, NULL); + return Val_unit; } CAMLprim value -perl4caml_init (value unit) +perl4caml_current_interpreter (value unit) { - static char *argv[] = { "", "-w", "-e", "0" }; - int argc = sizeof argv / sizeof argv[0]; - - PERL_SYS_INIT3 (NULL, NULL, NULL); + CAMLparam1 (unit); + if (my_perl == 0) raise_not_found (); + return Val_perl (my_perl); +} - /* Create a default interpreter. */ - my_perl = perl_alloc (); - perl_construct (my_perl); - PL_exit_flags |= PERL_EXIT_DESTRUCT_END; - perl_parse (my_perl, xs_init, argc, argv, NULL); - /*perl_run (my_perl);*/ +static void +xs_init (pTHX) +{ + char *file = __FILE__; + EXTERN_C void boot_DynaLoader (pTHX_ CV* cv); - return Val_unit; + newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); } CAMLprim value @@ -77,12 +75,12 @@ perl4caml_create (value optargs, value unit) CAMLlocal1 (args); int argc, i; char **argv; - static char *no_args[] = { "", "-e", "0" }; + static char *no_args[] = { "", "-w", "-e", "0" }; /* Arguments given? */ if (optargs == Val_int (0)) /* "None" */ { - argc = 3; + argc = 4; argv = no_args; } else /* "Some args" where args is a string array. */ @@ -103,17 +101,16 @@ perl4caml_create (value optargs, value unit) } CAMLprim value -perl4caml_destroy (value unit) +perl4caml_destroy (value plv) { - CAMLparam1 (unit); + CAMLparam1 (plv); + PerlInterpreter *pl = Perl_val (plv); - perl_destruct (my_perl); - perl_free (my_perl); + perl_destruct (pl); + perl_free (pl); - /* Force a segfault if someone tries to use a Perl function without - * creating another interpreter first. - */ - my_perl = 0; + /* Current interpreter? */ + if (my_perl == pl) my_perl = 0; CAMLreturn (Val_unit); } diff --git a/perl_init.ml b/perl_init.ml deleted file mode 100644 index 4f81139..0000000 --- a/perl_init.ml +++ /dev/null @@ -1,6 +0,0 @@ -(* Every program must link with perl_init.cmo (or perl_init.cmx). - * Copyright (C) 2003 Merjis Ltd. - * $Id: perl_init.ml,v 1.1 2003-10-12 17:33:14 rich Exp $ - *) - -Perl.init () diff --git a/wrappers/pl_HTML_Element.ml b/wrappers/pl_HTML_Element.ml index 7c6f470..c37a51d 100644 --- a/wrappers/pl_HTML_Element.ml +++ b/wrappers/pl_HTML_Element.ml @@ -1,10 +1,12 @@ (* Wrapper around Perl HTML::Element class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_HTML_Element.ml,v 1.2 2003-10-14 16:05:22 rich Exp $ + * $Id: pl_HTML_Element.ml,v 1.3 2003-10-15 16:51:12 rich Exp $ *) open Perl +let _ = eval "use HTML::Element" + type 'a content_t = Element of 'a | String of string class html_element sv = diff --git a/wrappers/pl_HTML_Parser.ml b/wrappers/pl_HTML_Parser.ml index 150547a..ec01e5f 100644 --- a/wrappers/pl_HTML_Parser.ml +++ b/wrappers/pl_HTML_Parser.ml @@ -1,10 +1,12 @@ (* Wrapper around Perl HTML::Parser class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_HTML_Parser.ml,v 1.1 2003-10-12 17:33:15 rich Exp $ + * $Id: pl_HTML_Parser.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl +let _ = eval "use HTML::Parser" + class html_parser sv = object (self) diff --git a/wrappers/pl_HTML_TreeBuilder.ml b/wrappers/pl_HTML_TreeBuilder.ml index f3a6032..61e8a03 100644 --- a/wrappers/pl_HTML_TreeBuilder.ml +++ b/wrappers/pl_HTML_TreeBuilder.ml @@ -1,6 +1,6 @@ (* Wrapper around Perl HTML::TreeBuilder class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_HTML_TreeBuilder.ml,v 1.1 2003-10-12 17:33:15 rich Exp $ + * $Id: pl_HTML_TreeBuilder.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl @@ -8,6 +8,8 @@ open Perl open Pl_HTML_Parser open Pl_HTML_Element +let _ = eval "use HTML::TreeBuilder" + class html_treebuilder sv = object (self) diff --git a/wrappers/pl_HTTP_Message.ml b/wrappers/pl_HTTP_Message.ml index 53d69de..12d0ffc 100644 --- a/wrappers/pl_HTTP_Message.ml +++ b/wrappers/pl_HTTP_Message.ml @@ -1,10 +1,12 @@ (* Wrapper around Perl HTTP::Message class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_HTTP_Message.ml,v 1.1 2003-10-12 17:33:15 rich Exp $ + * $Id: pl_HTTP_Message.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl +let _ = eval "use HTTP::Message" + class http_message sv = object (self) diff --git a/wrappers/pl_HTTP_Request.ml b/wrappers/pl_HTTP_Request.ml index be17e17..718c43a 100644 --- a/wrappers/pl_HTTP_Request.ml +++ b/wrappers/pl_HTTP_Request.ml @@ -1,6 +1,6 @@ (* Wrapper around Perl HTTP::Request class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_HTTP_Request.ml,v 1.1 2003-10-12 17:33:15 rich Exp $ + * $Id: pl_HTTP_Request.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl @@ -8,6 +8,8 @@ open Perl open Pl_HTTP_Message open Pl_URI +let _ = eval "use HTTP::Request" + class http_request sv = object (self) diff --git a/wrappers/pl_HTTP_Response.ml b/wrappers/pl_HTTP_Response.ml index 2bb479e..806df91 100644 --- a/wrappers/pl_HTTP_Response.ml +++ b/wrappers/pl_HTTP_Response.ml @@ -1,12 +1,14 @@ (* Wrapper around Perl HTTP::Response class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_HTTP_Response.ml,v 1.1 2003-10-12 17:33:15 rich Exp $ + * $Id: pl_HTTP_Response.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl open Pl_HTTP_Message +let _ = eval "use HTTP::Response" + class http_response sv = object (self) diff --git a/wrappers/pl_LWP_UserAgent.ml b/wrappers/pl_LWP_UserAgent.ml index 2a68f4a..29fc7f4 100644 --- a/wrappers/pl_LWP_UserAgent.ml +++ b/wrappers/pl_LWP_UserAgent.ml @@ -1,6 +1,6 @@ (* Wrapper around Perl LWP::UserAgent class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_LWP_UserAgent.ml,v 1.1 2003-10-12 17:33:15 rich Exp $ + * $Id: pl_LWP_UserAgent.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl @@ -8,6 +8,8 @@ open Perl open Pl_HTTP_Request open Pl_HTTP_Response +let _ = eval "use LWP::UserAgent" + class lwp_useragent sv = object (self) diff --git a/wrappers/pl_Net_Google.ml b/wrappers/pl_Net_Google.ml index 0ebebbe..8c5a19b 100644 --- a/wrappers/pl_Net_Google.ml +++ b/wrappers/pl_Net_Google.ml @@ -1,6 +1,6 @@ (* Wrapper around Perl Net::Google class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_Net_Google.ml,v 1.1 2003-10-14 16:05:22 rich Exp $ + * $Id: pl_Net_Google.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl @@ -9,6 +9,8 @@ open Pl_Net_Google_Cache open Pl_Net_Google_Search open Pl_Net_Google_Spelling +let _ = eval "use Net::Google" + let may f = function None -> () | Some v -> f v class net_google sv = diff --git a/wrappers/pl_Net_Google_Cache.ml b/wrappers/pl_Net_Google_Cache.ml index 542914f..730482f 100644 --- a/wrappers/pl_Net_Google_Cache.ml +++ b/wrappers/pl_Net_Google_Cache.ml @@ -1,10 +1,12 @@ (* Wrapper around Perl Net::Google::Cache class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_Net_Google_Cache.ml,v 1.1 2003-10-14 16:05:22 rich Exp $ + * $Id: pl_Net_Google_Cache.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl +let _ = eval "use Net::Google::Cache" + class net_google_cache sv = object (self) diff --git a/wrappers/pl_Net_Google_Response.ml b/wrappers/pl_Net_Google_Response.ml index a134d10..8e69538 100644 --- a/wrappers/pl_Net_Google_Response.ml +++ b/wrappers/pl_Net_Google_Response.ml @@ -1,10 +1,12 @@ (* Wrapper around Perl Net::Google::Reponse class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_Net_Google_Response.ml,v 1.1 2003-10-14 16:05:22 rich Exp $ + * $Id: pl_Net_Google_Response.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl +let _ = eval "use Net::Google::Response" + class net_google_response sv = object (self) diff --git a/wrappers/pl_Net_Google_Search.ml b/wrappers/pl_Net_Google_Search.ml index ad9d715..51ff941 100644 --- a/wrappers/pl_Net_Google_Search.ml +++ b/wrappers/pl_Net_Google_Search.ml @@ -1,12 +1,14 @@ (* Wrapper around Perl Net::Google::Search class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_Net_Google_Search.ml,v 1.1 2003-10-14 16:05:22 rich Exp $ + * $Id: pl_Net_Google_Search.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl open Pl_Net_Google_Response +let _ = eval "use Net::Google::Search" + class net_google_search sv = object (self) diff --git a/wrappers/pl_Net_Google_Spelling.ml b/wrappers/pl_Net_Google_Spelling.ml index 7fdc189..6988e62 100644 --- a/wrappers/pl_Net_Google_Spelling.ml +++ b/wrappers/pl_Net_Google_Spelling.ml @@ -1,10 +1,12 @@ (* Wrapper around Perl Net::Google::Spelling class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_Net_Google_Spelling.ml,v 1.1 2003-10-14 16:05:22 rich Exp $ + * $Id: pl_Net_Google_Spelling.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl +let _ = eval "use Net::Google::Spelling" + class net_google_spelling sv = object (self) diff --git a/wrappers/pl_URI.ml b/wrappers/pl_URI.ml index b590b24..4c680be 100644 --- a/wrappers/pl_URI.ml +++ b/wrappers/pl_URI.ml @@ -1,10 +1,12 @@ (* Wrapper around Perl URI class. * Copyright (C) 2003 Merjis Ltd. - * $Id: pl_URI.ml,v 1.1 2003-10-12 17:33:15 rich Exp $ + * $Id: pl_URI.ml,v 1.2 2003-10-15 16:51:12 rich Exp $ *) open Perl +let _ = eval "use URI" + class uri sv = object (self)