This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Change t/pragma/warn oct()/hex() overflow tests to use %Config
[perl5.git] / pod / perlguts.pod
index c41778c..2c6d3a2 100644 (file)
@@ -68,7 +68,7 @@ C<sv_setpvfn> is an analogue of C<vsprintf>, but it allows you to specify
 either a pointer to a variable argument list or the address and length of
 an array of SVs.  The last argument points to a boolean; on return, if that
 boolean is true, then locale-specific information has been used to format
-the string, and the string's contents are therefore untrustworty (see
+the string, and the string's contents are therefore untrustworthy (see
 L<perlsec>).  This pointer may be NULL if that information is not
 important.  Note that this function requires you to specify the length of
 the format.
@@ -151,7 +151,7 @@ If you want to append something to the end of string stored in an C<SV*>,
 you can use the following functions:
 
     void  sv_catpv(SV*, const char*);
-    void  sv_catpvn(SV*, const char*, int);
+    void  sv_catpvn(SV*, const char*, STRLEN);
     void  sv_catpvf(SV*, const char*, ...);
     void  sv_catpvfn(SV*, const char*, STRLEN, va_list *, SV **, I32, bool);
     void  sv_catsv(SV*, SV*);
@@ -503,7 +503,7 @@ reference is rv.  SV is blessed if C<classname> is non-null.
 Copies string into an SV whose reference is C<rv>.  Set length to 0 to let
 Perl calculate the string length.  SV is blessed if C<classname> is non-null.
 
-       SV* sv_setref_pvn(SV* rv, const char* classname, PV iv, int length);
+       SV* sv_setref_pvn(SV* rv, const char* classname, PV iv, STRLEN length);
 
 Tests whether the SV is blessed into the specified class.  It does not
 check inheritance relationships.
@@ -1791,7 +1791,7 @@ method's CV, which can be obtained from the GV with the C<GvCV> macro.
 =item gv_fetchmethod_autoload
 
 Returns the glob which contains the subroutine to call to invoke the
-method on the C<stash>.  In fact in the presense of autoloading this may
+method on the C<stash>.  In fact in the presence of autoloading this may
 be the glob for "AUTOLOAD".  In this case the corresponding variable
 $AUTOLOAD is already setup.
 
@@ -2286,7 +2286,8 @@ SV is set to 1.
 =item newSVpv
 
 Creates a new SV and copies a string into it.  The reference count for the
-SV is set to 1.  If C<len> is zero then Perl will compute the length.
+SV is set to 1.  If C<len> is zero, Perl will compute the length using
+strlen().  For efficiency, consider using C<newSVpvn> instead.
 
        SV*     newSVpv (const char* s, STRLEN len)
 
@@ -2295,13 +2296,14 @@ SV is set to 1.  If C<len> is zero then Perl will compute the length.
 Creates a new SV an initialize it with the string formatted like
 C<sprintf>.
 
-       SV*     newSVpvf(const char* pat, ...);
+       SV*     newSVpvf(const char* pat, ...)
 
 =item newSVpvn
 
 Creates a new SV and copies a string into it.  The reference count for the
-SV is set to 1.  If C<len> is zero then Perl will create a zero length 
-string.
+SV is set to 1.  Note that if C<len> is zero, Perl will create a zero length 
+string.  You are responsible for ensuring that the source string is at least
+C<len> bytes long.
 
        SV*     newSVpvn (const char* s, STRLEN len)
 
@@ -2424,9 +2426,10 @@ set and the variable does not exist then NULL is returned.
 
 =item perl_get_cv
 
-Returns the CV of the specified Perl sub.  If C<create> is set and the Perl
-variable does not exist then it will be created.  If C<create> is not
-set and the variable does not exist then NULL is returned.
+Returns the CV of the specified Perl subroutine.  If C<create> is set and
+the Perl subroutine does not exist then it will be declared (which has
+the same effect as saying C<sub name;>).  If C<create> is not
+set and the subroutine does not exist then NULL is returned.
 
        CV*     perl_get_cv (const char* name, I32 create)
 
@@ -2772,7 +2775,7 @@ Returns a boolean indicating whether the SV is derived from the specified
 class.  This is the function that implements C<UNIVERSAL::isa>.  It works
 for class names as well as for objects.
 
-       bool    sv_derived_from _((SV* sv, const char* name));
+       bool    sv_derived_from (SV* sv, const char* name);
 
 =item SvEND
 
@@ -3032,21 +3035,21 @@ Checks the B<private> setting.  Use C<SvPOK>.
 Returns a pointer to the string in the SV, or a stringified form of the SV
 if the SV does not contain a string.  Handles 'get' magic.
 
-       char*   SvPV (SV* sv, int len)
+       char*   SvPV (SV* sv, STRLEN len)
 
 =item SvPV_force
 
 Like <SvPV> but will force the SV into becoming a string (SvPOK).  You
 want force if you are going to update the SvPVX directly.
 
-       char*   SvPV_force(SV* sv, int len)
+       char*   SvPV_force(SV* sv, STRLEN len)
 
 =item SvPV_nolen
 
 Returns a pointer to the string in the SV, or a stringified form of the SV
 if the SV does not contain a string.  Handles 'get' magic.
 
-       char*   SvPV (SV* sv)
+       char*   SvPV_nolen (SV* sv)
 
 =item SvPVX
 
@@ -3399,18 +3402,18 @@ Processes its arguments like C<vsprintf> and appends the formatted output
 to an SV.  Uses an array of SVs if the C style variable argument list is
 missing (NULL).  Indicates if locale information has been used for formatting.
 
-       void    sv_catpvfn _((SV* sv, const char* pat, STRLEN patlen,
-                             va_list *args, SV **svargs, I32 svmax,
-                             bool *used_locale));
+       void    sv_catpvfn (SV* sv, const char* pat, STRLEN patlen,
+                           va_list *args, SV **svargs, I32 svmax,
+                           bool *used_locale);
 
 =item sv_vsetpvfn(sv, pat, patlen, args, svargs, svmax, used_locale)
 
 Works like C<vcatpvfn> but copies the text into the SV instead of
 appending it.
 
-       void    sv_setpvfn _((SV* sv, const char* pat, STRLEN patlen,
-                             va_list *args, SV **svargs, I32 svmax,
-                             bool *used_locale));
+       void    sv_setpvfn (SV* sv, const char* pat, STRLEN patlen,
+                           va_list *args, SV **svargs, I32 svmax,
+                           bool *used_locale);
 
 =item SvUV