X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlguts.pod;h=9b16a8a0263bd3fb2208b64c2f5a7bb1c34c2f09;hb=b0fffe302ebecea108e16fbf94d910405cdc8714;hp=b835b59a3816f068190b3b4de191a9ba36e812d8;hpb=ab19240082dfba31ce2fd03e2c5d9e7779bcdc76;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlguts.pod b/pod/perlguts.pod index b835b59..9b16a8a 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -95,7 +95,8 @@ or string. In the C macro, the length of the string returned is placed into the variable C (this is a macro, so you do I use C<&len>). If you do not -care what the length of the data is, use the global variable C. Remember, +care what the length of the data is, use the global variable C, 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, 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-like construct is created by a pair of -C/C macros (see L). 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/C pair. +C/C macros (see L). +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/C pair. Inside such a I the following service is available: @@ -1502,7 +1503,7 @@ It is strongly recommended that all Perl API functions that don't begin with C be referenced with an explicit C 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. 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 value, doing any necessary dereferencing of possibly C keys. The length of the string is placed in C (this is a macro, so do I use C<&len>). If you do not care about what the length of the key is, -you may use the global variable C. Remember though, that hash +you may use the global variable C, 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 or similar is not a good way to find the length of hash keys. This is very similar to the C macro described elsewhere in @@ -2169,6 +2171,15 @@ Do magic after a value is assigned to the SV. See C. int mg_set (SV* sv) +=item modglobal + +C 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 function. The C is the @@ -2179,8 +2190,9 @@ the type. Can do overlapping moves. See also C. =item PL_na -A variable which may be used with C to tell Perl to calculate the -string length. +A convenience variable which is typically used with C 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 setting. Use C. =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 is C 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 )