Update docs for XS AUTOLOAD
authorFather Chrysostomos <sprout@cpan.org>
Sun, 9 Oct 2011 05:23:50 +0000 (22:23 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 10 Oct 2011 06:14:07 +0000 (23:14 -0700)
This mentions the UTF8 flag and moves the discussion to perlapi, where
it belongs, IMHO.

pod/perlsub.pod
sv.h

index 35d34f2..6d034f1 100644 (file)
@@ -1433,8 +1433,7 @@ is not passed as an ordinary argument because, er, well, just
 because, that's why.  (As an exception, a method call to a nonexistent
 C<import> or C<unimport> method is just skipped instead.  Also, if
 the AUTOLOAD subroutine is an XSUB, C<$AUTOLOAD> is not populated;
-instead, you should call L<< C<SvPVX>E<sol>C<SvCUR>|perlapi >> on the
-C<CV> for C<AUTOLOAD> to retrieve the method name.)
+see L<perlapi/SvPVX> for details.)
 
 
 Many C<AUTOLOAD> routines load in a definition for the requested
diff --git a/sv.h b/sv.h
index c056423..46e53ac 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -685,6 +685,11 @@ Only use when you are sure SvNOK is true. See also C<SvNV()>.
 Returns a pointer to the physical string in the SV.  The SV must contain a
 string.
 
+During autoloading, if the AUTOLOAD routine is an XSUB, C<SvPVX(cv)>
+returns the name of the subroutine for which AUTOLOAD was invoked.
+Likewise, C<SvCUR(cv)> returns the length, and C<SvUTF8(cv)> returns true
+if the name is in UTF8.
+
 =for apidoc Am|STRLEN|SvCUR|SV* sv
 Returns the length of the string which is in the SV.  See C<SvLEN>.