📄 b.pm
字号:
| +------------+------------+------------+ | | | | B::PV B::IV B::NV B::RV \ / / \ / / B::PVIV / \ / \ / \ / B::PVNV | | B::PVMG | +-----+-----+-----+-----+ | | | | | B::AV B::GV B::HV B::CV B::IO | | | | B::PVLV B::FMFor 5.9.0 and earlier, PVLV is a direct subclass of PVMG, and BM is stillpresent as a distinct type, so the base of this diagram is | | B::PVMG | +------+-----+-----+-----+-----+-----+ | | | | | | | B::PVLV B::BM B::AV B::GV B::HV B::CV B::IO | | B::FMAccess methods correspond to the underlying C macros for field access,usually with the leading "class indication" prefix removed (Sv, Av,Hv, ...). The leading prefix is only left in cases where its removalwould cause a clash in method name. For example, C<GvREFCNT> staysas-is since its abbreviation would clash with the "superclass" methodC<REFCNT> (corresponding to the C function C<SvREFCNT>).=head2 B::SV Methods=over 4=item REFCNT=item FLAGS=item object_2svrefReturns a reference to the regular scalar corresponding to thisB::SV object. In other words, this method is the inverse operationto the svref_2object() subroutine. This scalar and other data it pointsat should be considered read-only: modifying them is neither safe norguaranteed to have a sensible effect.=back=head2 B::IV Methods=over 4=item IVReturns the value of the IV, I<interpreted asa signed integer>. This will be misleadingif C<FLAGS & SVf_IVisUV>. Perhaps you want theC<int_value> method instead?=item IVX=item UVX=item int_valueThis method returns the value of the IV as an integer.It differs from C<IV> in that it returns the correctvalue regardless of whether it's stored signed orunsigned.=item needs64bits=item packiv=back=head2 B::NV Methods=over 4=item NV=item NVX=back=head2 B::RV Methods=over 4=item RV=back=head2 B::PV Methods=over 4=item PVThis method is the one you usually want. It constructs astring using the length and offset information in the struct:for ordinary scalars it will return the string that you'd seefrom Perl, even if it contains null characters.=item RVSame as B::RV::RV, except that it will die() if the PV isn'ta reference.=item PVXThis method is less often useful. It assumes that the stringstored in the struct is null-terminated, and disregards thelength information.It is the appropriate method to use if you need to get the nameof a lexical variable from a padname array. Lexical variable namesare always stored with a null terminator, and the length field(SvCUR) is overloaded for other purposes and can't be relied on here.=back=head2 B::PVMG Methods=over 4=item MAGIC=item SvSTASH=back=head2 B::MAGIC Methods=over 4=item MOREMAGIC=item precompOnly valid on r-magic, returns the string that generated the regexp.=item PRIVATE=item TYPE=item FLAGS=item OBJWill die() if called on r-magic.=item PTR=item REGEXOnly valid on r-magic, returns the integer value of the REGEX storedin the MAGIC.=back=head2 B::PVLV Methods=over 4=item TARGOFF=item TARGLEN=item TYPE=item TARG=back=head2 B::BM Methods=over 4=item USEFUL=item PREVIOUS=item RARE=item TABLE=back=head2 B::GV Methods=over 4=item is_emptyThis method returns TRUE if the GP field of the GV is NULL.=item NAME=item SAFENAMEThis method returns the name of the glob, but if the firstcharacter of the name is a control character, then it convertsit to ^X first, so that *^G would return "^G" rather than "\cG".It's useful if you want to print out the name of a variable.If you restrict yourself to globs which exist at compile-timethen the result ought to be unambiguous, because code likeC<${"^G"} = 1> is compiled as two ops - a constant string anda dereference (rv2gv) - so that the glob is created at runtime.If you're working with globs at runtime, and need to disambiguate*^G from *{"^G"}, then you should use the raw NAME method.=item STASH=item SV=item IO=item FORM=item AV=item HV=item EGV=item CV=item CVGEN=item LINE=item FILE=item FILEGV=item GvREFCNT=item FLAGS=back=head2 B::IO Methods=over 4=item LINES=item PAGE=item PAGE_LEN=item LINES_LEFT=item TOP_NAME=item TOP_GV=item FMT_NAME=item FMT_GV=item BOTTOM_NAME=item BOTTOM_GV=item SUBPROCESS=item IoTYPE=item IoFLAGS=item IsSTDTakes one arguments ( 'stdin' | 'stdout' | 'stderr' ) and returns trueif the IoIFP of the object is equal to the handle whose name waspassed as argument ( i.e. $io->IsSTD('stderr') is true ifIoIFP($io) == PerlIO_stdin() ).=back=head2 B::AV Methods=over 4=item FILL=item MAX=item ARRAY=item ARRAYeltLike C<ARRAY>, but takes an index as an argument to get only one element,rather than a list of all of them.=item OFFThis method is deprecated if running under Perl 5.8, and is no longer presentif running under Perl 5.9=item AvFLAGSThis method returns the AV specific flags. In Perl 5.9 these are now storedin with the main SV flags, so this method is no longer present.=back=head2 B::CV Methods=over 4=item STASH=item START=item ROOT=item GV=item FILE=item DEPTH=item PADLIST=item OUTSIDE=item OUTSIDE_SEQ=item XSUB=item XSUBANYFor constant subroutines, returns the constant SV returned by the subroutine.=item CvFLAGS=item const_sv=back=head2 B::HV Methods=over 4=item FILL=item MAX=item KEYS=item RITER=item NAME=item ARRAY=item PMROOTThis method is not present if running under Perl 5.9, as the PMROOTinformation is no longer stored directly in the hash.=back=head2 OP-RELATED CLASSESC<B::OP>, C<B::UNOP>, C<B::BINOP>, C<B::LOGOP>, C<B::LISTOP>, C<B::PMOP>,C<B::SVOP>, C<B::PADOP>, C<B::PVOP>, C<B::LOOP>, C<B::COP>.These classes correspond in the obvious way to the underlying Cstructures of similar names. The inheritance hierarchy mimics theunderlying C "inheritance": B::OP | +---------------+--------+--------+-------+ | | | | | B::UNOP B::SVOP B::PADOP B::COP B::PVOP ,' `-. / `--. B::BINOP B::LOGOP | | B::LISTOP ,' `. / \ B::LOOP B::PMOPAccess methods correspond to the underlying C structre field names,with the leading "class indication" prefix (C<"op_">) removed.=head2 B::OP MethodsThese methods get the values of similarly named fields within the OPdata structure. See top of C<op.h> for more info.=over 4=item next=item sibling=item nameThis returns the op name as a string (e.g. "add", "rv2av").=item ppaddrThis returns the function name as a string (e.g. "PL_ppaddr[OP_ADD]","PL_ppaddr[OP_RV2AV]").=item descThis returns the op description from the global C PL_op_desc array(e.g. "addition" "array deref").=item targ=item type=item opt=item flags=item private=item spare=back=head2 B::UNOP METHOD=over 4=item first=back=head2 B::BINOP METHOD=over 4=item last=back=head2 B::LOGOP METHOD=over 4=item other=back=head2 B::LISTOP METHOD=over 4=item children=back=head2 B::PMOP Methods=over 4=item pmreplroot=item pmreplstart=item pmnext=item pmregexp=item pmflags=item extflags=item precomp=item pmoffsetOnly when perl was compiled with ithreads.=back=head2 B::SVOP METHOD=over 4=item sv=item gv=back=head2 B::PADOP METHOD=over 4=item padix=back=head2 B::PVOP METHOD=over 4=item pv=back=head2 B::LOOP Methods=over 4=item redoop=item nextop=item lastop=back=head2 B::COP Methods=over 4=item label=item stash=item stashpv=item file=item cop_seq=item arybase=item line=item warnings=item io=item hints=item hints_hash=back=head1 AUTHORMalcolm Beattie, C<mbeattie@sable.ox.ac.uk>=cut
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -