caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: caml-list@inria.fr
Subject: [Caml-list] perl4caml 0.3.10
Date: Thu, 25 Mar 2004 13:55:14 +0000	[thread overview]
Message-ID: <20040325135514.GA26055@redhat.com> (raw)


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


                 reply	other threads:[~2004-03-25 13:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040325135514.GA26055@redhat.com \
    --to=rich@annexia.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).