X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=examples%2Floadpage.ml;h=dfb4afd12aefa6b562727634b4fe1baa687221a7;hb=1a03f5caec9e996f5929dbe34cf85c54f7ee4893;hp=9f67907fb2f5b94473cdc157dfa1cedc9105a193;hpb=9e543055271a1ec799d56f507ab048c78d3d7a88;p=perl4caml.git diff --git a/examples/loadpage.ml b/examples/loadpage.ml index 9f67907..dfb4afd 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.4 2003-10-16 11:03:52 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,7 @@ let () = print tree; (* Destroy the Perl interpreter. *) - Perl.destroy () + Perl.destroy (Perl.current_interpreter ()); + + (* Perform a full collection - good way to find GC/allocation bugs. *) + Gc.full_major ()