Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] perl4caml 0.3.10
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: [Caml-list] perl4caml 0.3.10

I'm please to announce Perl4Caml 0.3.10, available here:

http://www.merjis.com/developers/perl4caml/

This version includes a wrapper around the Template Toolkit,
contributed by Dave Benjamin, and some cleanups for memory handling
(although memory handling still isn't quite right, and for this reason
the library doesn't free Perl objects - any help getting this right is
welcomed).

[From the website ...]

perl4caml allows you to use Perl code within Objective CAML (OCaml),
thus neatly side-stepping the old problem with OCaml which was that it
lacked a comprehensive set of libraries. Well now you can use any part
of CPAN in your OCaml code.

perl4caml has both a low-level interface to Perl, eg:

Perl.eval "$a = 3";
printf "$a contains %d\n" (Perl.int_of_sv (Perl.get_sv "a"));

and it contains high-level wrappers around some CPAN libraries (more
to come later), eg:

open Pl_LWP_UserAgent
open Pl_HTTP_Request

(* Create the UserAgent object. *)
let ua = Pl_LWP_UserAgent.new_ ~env_proxy:true () in

(* Fetch the page. *)
let req = Pl_HTTP_Request.new_ "GET" ~uri:site () in
let res = ua#request req in

if not res#is_success then
  failwith ("Error while fetching " ^ site ^ ": " ^ res#status_line);


-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
Perl4Caml lets you use any Perl library in your type-safe Objective
CAML programs. http://www.merjis.com/developers/perl4caml/

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners