*
* Copyright (C) 2004 Merjis Ltd.
*
- * $Id: pl_WWW_Mechanize.ml,v 1.2 2004-11-26 13:33:10 rich Exp $
+ * $Id: pl_WWW_Mechanize.ml,v 1.3 2005-01-13 16:06:04 rich Exp $
*)
open Perl
(* XXX Should be able to pass args to constructor of LWP::UserAgent. *)
(* XXX WWW::Mechanize has additional parameters. *)
-let new_ () =
- let sv = call_class_method "WWW::Mechanize" "new" [] in
+let new_ ?autocheck () =
+ let args = ref [] in
+ let may f = function None -> () | Some v -> f v in
+ may (fun v ->
+ args := sv_of_string "autocheck" :: sv_of_bool v :: !args) autocheck;
+ let sv = call_class_method "WWW::Mechanize" "new" !args in
new www_mechanize sv