+val bool_of_sv : sv -> bool
+(** Convert an [SV] into a boolean. *)
+val sv_of_bool : bool -> sv
+(** Convert a boolean into an [SV]. *)
+
+val sv_is_true : sv -> bool
+(** Return [true] if the [SV] is "true" (in the Perl sense of truth). *)
+val sv_is_undef : sv -> bool
+(** Return [true] if the [SV] is undefined (is [undef]). *)
+val sv_undef : unit -> sv
+(** Returns [undef]. *)
+val sv_true : unit -> sv
+(** Returns an [SV] which is true. *)
+val sv_false : unit -> sv
+(** Returns an [SV] which is false. *)
+val sv_yes : unit -> sv
+(** Returns Perl's internal [PL_sv_yes]. (There are some unresolved issues
+ * with using this, so use {!Perl.sv_true} instead). *)
+val sv_no : unit -> sv
+(** Returns Perl's internal [PL_sv_no]. (There are some unresolved issues
+ * with using this, so use {!Perl.sv_false} instead). *)
+
+(* Actually there are many more types defined than this ... *)
+type sv_t = SVt_NULL
+ | SVt_IV (** Integer scalar. *)
+ | SVt_NV (** Floating point scalar. *)
+ | SVt_PV (** String scalar. *)
+ | SVt_RV (** Reference. *)
+ | SVt_PVAV (** Array ref. *)
+ | SVt_PVHV (** Hash ref. *)
+ | SVt_PVCV (** Code ref. *)
+ | SVt_PVGV (** Glob. *)
+ | SVt_PVMG (** Blessed or magical scalar. *)
+val sv_type : sv -> sv_t
+(** Return the type of data contained in an [SV]. Somewhat equivalent to
+ * calling Perl's [ref] function.
+ *)
+val string_of_sv_t : sv_t -> string
+(** Return a printable string for an [sv_t] ([SV] type). *)
+
+val scalarref : sv -> sv
+(** Given a scalar, this returns a reference to the scalar. Note that
+ * because references are [SV]s, this returns [sv].
+ *)
+val arrayref : av -> sv
+(** Given an array, this returns a reference to the array. Note that
+ * because references are [SV]s, this returns [sv].
+ *)
+val hashref : hv -> sv
+(** Given a hash, this returns a reference to the hash. Note that
+ * because references are [SV]s, this returns [sv].
+ *)
+
+val deref : sv -> sv
+(** The input is a reference to a scalar. This returns the underlying
+ * scalar [SV]. If the input is not a reference to a scalar, throws
+ * [Invalid_argument].
+ *)
+val deref_array : sv -> av
+(** The input is a reference to an array. This returns the underlying
+ * array [AV]. If the input is not a reference to an array, throws
+ * [Invalid_argument].
+ *)
+val deref_hash : sv -> hv
+(** The input is a reference to a hash. This returns the underlying
+ * hash [HV]. If the input is not a reference to a hash, throws
+ * [Invalid_argument].
+ *)
+
+val av_empty : unit -> av
+(** Create an empty [AV] (array). *)
+val av_of_sv_list : sv list -> av
+(** Create an array from a list of [SVs]. *)
+val av_push : av -> sv -> unit
+(** Append the [SV] to the end of the array. Same as Perl
+ * [push \@av, $sv]. *)
+val av_pop : av -> sv
+(** Remove the [SV] at the end of the array and return it. Same as
+ * Perl [$sv = pop \@av]. *)
+val av_shift : av -> sv
+(** Remove the [SV] at the beginning of the array and return it. Same as
+ * Perl [$sv = shift \@av]. *)
+val av_unshift : av -> sv -> unit
+(** Prepend the [SV] to the start of the array. Same as Perl
+ * [unshift \@av, $sv]. *)
+val av_length : av -> int
+(** Return the length of the [AV]. *)
+val av_set : av -> int -> sv -> unit
+(** Replace the i'th element of the [AV] with [SV]. *)
+val av_get : av -> int -> sv
+(** Get the i'th element of the [AV]. *)
+val av_clear : av -> unit
+(** Remove all elements from the [AV]. Same as Perl [\@av = ()]. *)
+val av_undef : av -> unit
+(** Delete the [AV] (and all elements in it). Same as Perl [undef \@av]. *)
+val av_extend : av -> int -> unit
+(** Extend the [AV] so it contains at least [n+1] elements. *)
+val av_map : (sv -> 'a) -> av -> 'a list
+(** Map a function over the elements in the [AV], return a list of the
+ * results. *)
+val list_of_av : av -> sv list
+(** Convert an [AV] into a simple list of [SV]s. *)
+val av_of_string_list : string list -> av
+(** Build an [AV] from a list of strings. *)