(* 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
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
(fun response ->
printf "* %s\n <URL:%s>\n\n" response#title response#url
) search#results;
+
+ (* Destroy the Perl interpreter. *)
+ Perl.destroy (Perl.current_interpreter ())