*
* Copyright (C) 2003 Merjis Ltd.
*
- * $Id: perl.mli,v 1.10 2003-10-26 11:22:38 rich Exp $
+ * $Id: perl.mli,v 1.11 2003-12-11 17:41:52 rich Exp $
*)
-type t
-(** Perl interpreter (abstract type). *)
-
type sv
(** Perl scalar value. *)
exception Perl_failure of string
(** [die] in Perl code is translated automatically into this exception. *)
-val current_interpreter : unit -> t
-(** The [Perl] module has a notion of the "current" interpreter. Throws
- * [Not_found] if there is no current interpreter.
- *
- * When a program starts up, if it has been linked with [perl_init.cmo]
- * (which is should be), an interpreter is created for you. Normally
- * this should be all you need to know about interpreters, unless you
- * want to be really good and call
- * [Perl.destroy (Perl.current_interpreter ())] at the end of your
- * program to do proper cleanup.
- *
- * You can also, under certain circumstances, create other interpreters,
- * although this is experiemental and definitely not recommended.
- *
- * If Perl was compiled with [-Dusemultiplicity] then you can create
- * mutliple interpreters at the same time and switch between them by
- * calling {!Perl.set_context}.
- *
- * Otherwise you may destroy the current interpreter and create another
- * one (provided that at no time you have two "live" interpreters),
- * by calling {!Perl.destroy} followed by {!Perl.create}.
-*)
-
-val destroy : t -> unit
-(** Destroy the Perl interpreter, performing any necessary cleanup.
- *
- * You should call [Perl.destroy (Perl.current_interpreter ())] at
- * the end of your program, otherwise Perl won't properly clean up
- * (running [END] blocks, destroying objects and the like).
- *
- * Note that a Perl interpreter is created for you by default when you
- * use perl4caml.
- *
- * The current interpreter can be found by calling
- * {!Perl.current_interpreter}.
- *)
-
-val create : ?args:string array -> unit -> t
-(** Create a new Perl interpreter. (Note that a Perl interpreter is created
- * for you by default so you don't need to call this).
- *
- * The optional [?args] parameter is the command line passed to the
- * interpreter, and controls things like whether warnings are enabled
- * ([-w]) and which file(s) are parsed. The first element in the
- * array is the executable name (you can just set this to [""]).
- *
- * Perl won't allow you to create multiple interpreters at the same time
- * unless Perl itself was compiled with [-Dusemultiplicity]. However you
- * can create, then destroy, then create another and so on.
- *
- * The newly created interpreter is set as the "current interpreter".
- *)
-
-val set_context : t -> unit
-(** IF Perl was compiled with [-Dusemultiplicity] and IF you are using
- * multiple interpreters at the same time, then you must call this to
- * set the implied "current" interpreter.
- *
- * Most users will never need to call this function.
- *)
-
val int_of_sv : sv -> int
(** Convert a Perl [SV] into an integer. Note that OCaml [int]s aren't
* large enough to store the full 32 (or 64) bits from a Perl integer,