- GvSV
-
Return the SV from the GV.
- gv_fetchmeth
-
Returns the glob with the given name and a defined subroutine or NULL.
The glob lives in the given stash, or in the stashes accessible via @ISA and
UNIVERSAL::.
The argument level should be either 0 or -1. If level==0, as
a side-effect creates a glob with the given name in the given 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 "SUPER" token as a postfix of the stash
name. The GV returned from gv_fetchmeth may be a method cache entry, which is
not visible to Perl code. So when calling call_sv, you should not use the GV
directly; instead, you should use the method's CV, which can be obtained from the GV with
the GvCV macro.
GV* gv_fetchmeth(HV* stash, const char* name, STRLEN len, I32 level)
|
|
- gv_fetchmethod
-
See gv_fetchmethod_autoload.
GV* gv_fetchmethod(HV* stash, const char* name)
|
|
- gv_fetchmethod_autoload
-
Returns the glob which contains the subroutine to call to invoke the method on the stash.
In fact in the presence of autoloading this may be the glob for "AUTOLOAD". In
this case the corresponding variable $AUTOLOAD is already setup.
The third parameter of gv_fetchmethod_autoload determines whether AUTOLOAD
lookup is performed if the given method is not present: non-zero means yes, look for
AUTOLOAD; zero means no, don't look for AUTOLOAD. Calling gv_fetchmethod is
equivalent to calling gv_fetchmethod_autoload with a non-zero autoload
parameter.
These functions grant "SUPER" token as a prefix of the method
name. Note that if you want to keep the returned glob for a long time, you need to 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.
These functions have the same side-effects and as gv_fetchmeth with level==0.
name should be writable if contains ':' or ' ''.
The warning against passing the GV returned by gv_fetchmeth to call_sv
apply equally to these functions.
GV* gv_fetchmethod_autoload(HV* stash, const char* name, I32 autoload)
|
|
- gv_fetchmeth_autoload
-
Same as gv_fetchmeth(), but looks for autoloaded subroutines too. Returns a glob for
the subroutine.
For an autoloaded subroutine without a GV, will create a GV even if level < 0.
For an autoloaded subroutine without a stub, GvCV() of the result may be zero.
GV* gv_fetchmeth_autoload(HV* stash, const char* name, STRLEN len, I32 level)
|
|
- gv_stashpv
-
Returns a pointer to the stash for a specified package. name should be a
valid UTF-8 string. If create is set then the package will be created if it
does not already exist. If create is not set and the package does not exist
then NULL is returned.
HV* gv_stashpv(const char* name, I32 create)
|
|
- gv_stashsv
-
Returns a pointer to the stash for a specified package, which must be a valid UTF-8
string. See gv_stashpv.
HV* gv_stashsv(SV* sv, I32 create)
|
|
|
|