pods for subroutine argument autovivication
[p5sagit/p5-mst-13.2.git] / pod / perlguts.pod
index 5766cc0..866cafb 100644 (file)
@@ -162,7 +162,7 @@ bus error, or just weird results.  Change the zero to C<&sv_undef> in the first
 line and all will be well.
 
 To free an SV that you've created, call C<SvREFCNT_dec(SV*)>.  Normally this
-call is not necessary (see the section on L<Mortality>).
+call is not necessary (see the section on L<Reference Counts and Mortality>).
 
 =head2 What's Really Stored in an SV?
 
@@ -422,8 +422,8 @@ A reference can be blessed into a package with the following function:
     SV* sv_bless(SV* sv, HV* stash);
 
 The C<sv> argument must be a reference.  The C<stash> argument specifies
-which class the reference will belong to.  See the section on L<Stashes>
-for information on converting class names into stashes.
+which class the reference will belong to.  See the section on 
+L<Stashes and Globs> for information on converting class names into stashes.
 
 /* Still under construction */
 
@@ -777,9 +777,9 @@ The current kinds of Magic Virtual Tables are:
     .        vtbl_pos           $. scalar variable
     ~        None                Used by certain extensions
 
-When an upper-case and lower-case letter both exist in the table, then the
-upper-case letter is used to represent some kind of composite type (a list
-or a hash), and the lower-case letter is used to represent an element of
+When an uppercase and lowercase letter both exist in the table, then the
+uppercase letter is used to represent some kind of composite type (a list
+or a hash), and the lowercase letter is used to represent an element of
 that composite type.
 
 The '~' magic type is defined specifically for use by extensions and
@@ -805,12 +805,12 @@ if the SV is not of type SVt_PVMG, Perl may core-dump.
     int mg_copy(SV* sv, SV* nsv, char* key, STRLEN klen);
 
 This routine checks to see what types of magic C<sv> has.  If the mg_type
-field is an upper-case letter, then the mg_obj is copied to C<nsv>, but
-the mg_type field is changed to be the lower-case letter.
+field is an uppercase letter, then the mg_obj is copied to C<nsv>, but
+the mg_type field is changed to be the lowercase letter.
 
 =head1 Subroutines
 
-=head2 XSUB's and the Argument Stack
+=head2 XSUBs and the Argument Stack
 
 The XSUB mechanism is a simple way for Perl programs to access C subroutines.
 An XSUB routine will have a stack that contains the arguments from the Perl
@@ -954,7 +954,7 @@ The most recent development releases of Perl has been experimenting with
 removing Perl's dependency on the "normal" standard I/O suite and allowing
 other stdio implementations to be used.  This involves creating a new
 abstraction layer that then calls whichever implementation of stdio Perl
-was compiled with.  All XSUB's should now use the functions in the PerlIO
+was compiled with.  All XSUBs should now use the functions in the PerlIO
 abstraction layer and not make any assumptions about what kind of stdio
 is being used.
 
@@ -995,7 +995,7 @@ The correspondence between OP's and I<target>s is not 1-to-1. Different
 OP's in the compile tree of the unit can use the same target, if this
 would not conflict with the expected life of the temporary.
 
-=head2 Scratchpads and recursions
+=head2 Scratchpads and recursion
 
 In fact it is not 100% true that a compiled unit contains a pointer to
 the scratchpad AV. In fact it contains a pointer to an AV of
@@ -1370,15 +1370,17 @@ Used to indicate scalar context.  See C<GIMME> and L<perlcall>.
 =item gv_fetchmeth
 
 Returns the glob with the given C<name> and a defined subroutine or
-C<NULL>. The glob lives in the given C<stash>, or in the stashes accessable
-via @ISA and @<UNIVERSAL>.
+C<NULL>.  The glob lives in the given C<stash>, or in the stashes
+accessable via @ISA and @<UNIVERSAL>.
 
-The argument C<level> should be either 0 or -1. If C<level==0>, as a
+The argument C<level> should be either 0 or -1.  If C<level==0>, as a
 side-effect creates a glob with the given C<name> in the given
 C<stash> which in the case of success contains an alias for the
 subroutine, and sets up caching info for this glob.  Similarly for all
 the searched stashes.
 
+This function grants C<"SUPER"> token as a postfix of the stash name.
+
 The GV returned from C<gv_fetchmeth> may be a method cache entry,
 which is not visible to Perl code.  So when calling C<perl_call_sv>,
 you should not use the GV directly; instead, you should use the
@@ -1394,12 +1396,11 @@ be the glob for "AUTOLOAD".  In this case the corresponing variable
 $AUTOLOAD is already setup.
 
 Note that if you want to keep this glob for a long time, you need to
-check for it being "AUTOLOAD", since at the later time the the call
+check for it being "AUTOLOAD", since at the later time the call
 may load a different subroutine due to $AUTOLOAD changing its value.
 Use the glob created via a side effect to do this.
 
-This function grants C<"SUPER"> token as prefix of name or postfix of
-the stash name.
+This function grants C<"SUPER"> token as a prefix of the method name.
 
 Has the same side-effects and as C<gv_fetchmeth> with C<level==0>.
 C<name> should be writable if contains C<':'> or C<'\''>.
@@ -1426,27 +1427,12 @@ Returns a pointer to the stash for a specified package.  See C<gv_stashpv>.
 
 Return the SV from the GV.
 
-=item he_delayfree
-
-Releases a hash entry, such as while iterating though the hash, but
-delays actual freeing of key and value until the end of the current
-statement (or thereabouts) with C<sv_2mortal>.  See C<hv_iternext>.
-
-       void    he_delayfree _((HV* hv, HE* hent));
-
 =item HEf_SVKEY
 
 This flag, used in the length slot of hash entries and magic
 structures, specifies the structure contains a C<SV*> pointer where a
 C<char*> pointer is to be expected. (For information only--not to be used).
 
-=item he_free
-
-Releases a hash entry, such as while iterating though the hash.  See
-C<hv_iternext>.
-
-       void    he_free _((HV* hv, HE* hent));
-
 =item HeHASH
 
 Returns the computed hash (type C<U32>) stored in the hash entry.
@@ -1502,7 +1488,7 @@ mortal C<SV*> if the hash entry contains only a C<char*> key.
 =item HeSVKEY_set
 
 Sets the key to a given C<SV*>, taking care to set the appropriate flags
-to indicate the presence of an C<SV*> key.
+to indicate the presence of an C<SV*> key, and returns the same C<SV*>.
 
        HeSVKEY_set(HE* he, SV* sv)
 
@@ -1518,6 +1504,15 @@ Clears a hash, making it empty.
 
        void    hv_clear _((HV* tb));
 
+=item hv_delayfree_ent
+
+Releases a hash entry, such as while iterating though the hash, but
+delays actual freeing of key and value until the end of the current
+statement (or thereabouts) with C<sv_2mortal>.  See C<hv_iternext>
+and C<hv_free_ent>.
+
+       void    hv_delayfree_ent _((HV* hv, HE* entry));
+
 =item hv_delete
 
 Deletes a key/value pair in the hash.  The value SV is removed from the hash
@@ -1571,6 +1566,13 @@ structure if you need to store it somewhere.
 
        HE*     hv_fetch_ent  _((HV* tb, SV* key, I32 lval, U32 hash));
 
+=item hv_free_ent
+
+Releases a hash entry, such as while iterating though the hash.  See
+C<hv_iternext> and C<hv_delayfree_ent>.
+
+       void    hv_free_ent _((HV* hv, HE* entry));
+
 =item hv_iterinit
 
 Prepares a starting point to traverse a hash table.
@@ -1644,7 +1646,7 @@ Otherwise the contents of the return value can be accessed using the
 C<He???> macros described here.
 
        HE*     hv_store_ent  _((HV* tb, SV* key, SV* val, U32 hash));
-       
+
 =item hv_undef
 
 Undefines the hash.
@@ -1820,7 +1822,7 @@ SV is B<not> incremented.
 =item newSV
 
 Creates a new SV.  The C<len> parameter indicates the number of bytes of
-pre-allocated string space the SV should have.  The reference count for the
+preallocated string space the SV should have.  The reference count for the
 new SV is set to 1.
 
        SV*     newSV _((STRLEN len));
@@ -2898,14 +2900,14 @@ destination, C<n> is the number of items, and C<t> is the type.
 
 =head1 EDITOR
 
-Jeff Okamoto <okamoto@corp.hp.com>
+Jeff Okamoto <F<okamoto@corp.hp.com>>
 
 With lots of help and suggestions from Dean Roehrich, Malcolm Beattie,
 Andreas Koenig, Paul Hudson, Ilya Zakharevich, Paul Marquess, Neil
 Bowers, Matthew Green, Tim Bunce, Spider Boardman, and Ulrich Pfeifer.
 
-API Listing by Dean Roehrich <roehrich@cray.com>.
+API Listing by Dean Roehrich <F<roehrich@cray.com>>.
 
 =head1 DATE
 
-Version 31: 1997/1/27
+Version 31.3: 1997/3/14