modglobal w/ spelling fixes
[p5sagit/p5-mst-13.2.git] / pod / perlguts.pod
index b835b59..9b16a8a 100644 (file)
@@ -95,7 +95,8 @@ or string.
 
 In the C<SvPV> macro, the length of the string returned is placed into the
 variable C<len> (this is a macro, so you do I<not> use C<&len>).  If you do not
-care what the length of the data is, use the global variable C<PL_na>.  Remember,
+care what the length of the data is, use the global variable C<PL_na>, though
+this is rather less efficient than using a local variable.  Remember,
 however, that Perl allows arbitrary strings of data that may both contain
 NULs and might not be terminated by a NUL.
 
@@ -1024,13 +1025,13 @@ There is a way to achieve a similar task from C via Perl API: create a
 I<pseudo-block>, and arrange for some changes to be automatically
 undone at the end of it, either explicit, or via a non-local exit (via
 die()). A I<block>-like construct is created by a pair of
-C<ENTER>/C<LEAVE> macros (see L<perlcall/EXAMPLE/"Returning a
-Scalar">).  Such a construct may be created specially for some
-important localized task, or an existing one (like boundaries of
-enclosing Perl subroutine/block, or an existing pair for freeing TMPs)
-may be used. (In the second case the overhead of additional
-localization must be almost negligible.) Note that any XSUB is
-automatically enclosed in an C<ENTER>/C<LEAVE> pair.
+C<ENTER>/C<LEAVE> macros (see L<perlcall/"Returning a Scalar">).
+Such a construct may be created specially for some important localized
+task, or an existing one (like boundaries of enclosing Perl
+subroutine/block, or an existing pair for freeing TMPs) may be
+used. (In the second case the overhead of additional localization must
+be almost negligible.) Note that any XSUB is automatically enclosed in
+an C<ENTER>/C<LEAVE> pair.
 
 Inside such a I<pseudo-block> the following service is available:
 
@@ -1502,7 +1503,7 @@ It is strongly recommended that all Perl API functions that don't begin
 with C<perl> be referenced with an explicit C<Perl_> prefix.
 
 The sort order of the listing is case insensitive, with any
-occurrences of '_' ignored for the the purpose of sorting.
+occurrences of '_' ignored for the purpose of sorting.
 
 =over 8
 
@@ -1636,7 +1637,7 @@ the SV which holds the name of the sub being debugged.  This is the C
 variable which corresponds to Perl's $DB::sub variable.  See C<PL_DBsingle>.
 The sub name can be found by
 
-       SvPV( GvSV( PL_DBsub ), PL_na )
+       SvPV( GvSV( PL_DBsub ), len )
 
 =item PL_DBtrace
 
@@ -1856,7 +1857,8 @@ Returns the key slot of the hash entry as a C<char*> value, doing any
 necessary dereferencing of possibly C<SV*> keys.  The length of
 the string is placed in C<len> (this is a macro, so do I<not> use
 C<&len>).  If you do not care about what the length of the key is,
-you may use the global variable C<PL_na>.  Remember though, that hash
+you may use the global variable C<PL_na>, though this is rather less
+efficient than using a local variable.  Remember though, that hash
 keys in perl are free to contain embedded nulls, so using C<strlen()>
 or similar is not a good way to find the length of hash keys.
 This is very similar to the C<SvPV()> macro described elsewhere in
@@ -2169,6 +2171,15 @@ Do magic after a value is assigned to the SV.  See C<sv_magic>.
 
        int     mg_set (SV* sv)
 
+=item modglobal
+
+C<modglobal> is a general purpose, interpreter global HV for use by
+extensions.  While it could hold extension specific information, it is
+meant primarily for information that needs to be shared between
+extensions.  Moreover, while it could be used for any kind of
+information, it is meant for information that should be not accessible
+in the usual way from the perl symbol table.
+
 =item Move
 
 The XSUB-writer's interface to the C C<memmove> function.  The C<s> is the
@@ -2179,8 +2190,9 @@ the type.  Can do overlapping moves.  See also C<Copy>.
 
 =item PL_na
 
-A variable which may be used with C<SvPV> to tell Perl to calculate the
-string length.
+A convenience variable which is typically used with C<SvPV> when one doesn't
+care about the length of the string.  It is usually more efficient to
+declare a local variable and use that instead.
 
 =item New
 
@@ -3008,8 +3020,7 @@ Checks the B<private> setting.  Use C<SvPOK>.
 =item SvPV
 
 Returns a pointer to the string in the SV, or a stringified form of the SV
-if the SV does not contain a string.  If C<len> is C<PL_na> then Perl will
-handle the length on its own.  Handles 'get' magic.
+if the SV does not contain a string.  Handles 'get' magic.
 
        char*   SvPV (SV* sv, int len )