X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlcall.pod;h=dd520afcaa1aa967564721dc1090f5b58d845c57;hb=10ac92784f49d4a1fe54cc1ed7d05f0d3b2a2f29;hp=34f442a42429be724eeddddee9c20a9136e35fad;hpb=61eff3bce55f37db01a97cd993ca4e73fb953a10;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlcall.pod b/pod/perlcall.pod index 34f442a..dd520af 100644 --- a/pod/perlcall.pod +++ b/pod/perlcall.pod @@ -201,8 +201,8 @@ As with G_SCALAR, this flag has 2 effects: =item 1. -It indicates to the subroutine being called that it is executing in an -array context (if it executes I the result will be true). +It indicates to the subroutine being called that it is executing in a +list context (if it executes I the result will be true). =item 2. @@ -343,7 +343,11 @@ has no effect when G_EVAL is not used. When G_KEEPERR is used, any errors in the called code will be prefixed with the string "\t(in cleanup)", and appended to the current value -of C<$@>. +of C<$@>. an error will not be appended if that same error string is +already at the end of C<$@>. + +In addition, a warning is generated using the appended string. This can be +disabled using C. The G_KEEPERR flag was introduced in Perl version 5.002. @@ -355,7 +359,7 @@ use of this flag. As mentioned above, you can determine the context of the currently executing subroutine in Perl with I. The equivalent test can be made in C by using the C macro, which returns -C if you have been called in an array context, C if +C if you have been called in a list context, C if in a scalar context, or C if in a void context (i.e. the return value will not be used). An older version of this macro is called C; in a void context it returns C instead of @@ -589,12 +593,6 @@ local copy, I the global copy. =item 4. -The only flag specified this time is G_DISCARD. Because we are passing 2 -parameters to the Perl subroutine this time, we have not specified -G_NOARGS. - -=item 5. - Next, we come to XPUSHs. This is where the parameters actually get pushed onto the stack. In this case we are pushing a string and an integer. @@ -602,7 +600,7 @@ integer. See L for details on how the XPUSH macros work. -=item 6. +=item 5. Because we created temporary values (by means of sv_2mortal() calls) we will have to tidy up the Perl stack and dispose of mortal SVs. @@ -632,10 +630,12 @@ to limit the scope of local variables. See the section I for details of an alternative to using these macros. -=item 7. +=item 6. -Finally, I can now be called via the I -function. +Finally, I can now be called via the I function. +The only flag specified this time is G_DISCARD. Because we are passing +2 parameters to the Perl subroutine this time, we have not specified +G_NOARGS. =back @@ -806,7 +806,7 @@ Notes =item 1. -We wanted array context, so G_ARRAY was used. +We wanted list context, so G_ARRAY was used. =item 2. @@ -1939,7 +1939,7 @@ done inside our C code: C is used to compile the anonymous subroutine, which will be the return value as well (read more about C in -L). Once this code reference is in hand, it +L). Once this code reference is in hand, it can be mixed in with all the previous examples we've shown. =head1 SEE ALSO