toolset.pm

来自「外国人写的Perl搜索引擎程序」· PM 代码 · 共 122 行

PM
122
字号
package KinoSearch::Util::ToolSet;use strict;use warnings;use bytes;no bytes;use base qw( Exporter );use Carp qw( carp croak cluck confess );# everything except readonly and set_prototypeuse Scalar::Util qw(    refaddr    blessed    dualvar    isweak    refaddr    reftype    tainted    weaken    isvstring    looks_like_number);use KinoSearch qw( K_DEBUG kdump );use KinoSearch::Util::VerifyArgs qw( verify_args kerror a_isa_b );use KinoSearch::Util::MathUtils qw( ceil );our @EXPORT = qw(    carp    croak    cluck    confess    refaddr    blessed    dualvar    isweak    refaddr    reftype    tainted    weaken    isvstring    looks_like_number    K_DEBUG    kdump    kerror    verify_args    a_isa_b    ceil);1;__END__=head1 NAMEKinoSearch::Util::ToolSet - namespace pollution=head1 PRIVATE CLASSThis is a private class and the interface may change radically and withoutwarning.  Do not use it on its own.=head1 SYNOPSIS    use KinoSearch::Util::ToolSet;=head1 DESCRIPTIONKinoSearch::Util::ToolSet makes a slew of commonly needed symbols available toother modules in the KinoSearch suite.  At one time it was implemented usingDavid Golden's L<ToolSet|ToolSet> module, but in keeping with the philosophyof minimizing non-core dependencies, a 90% solution based on Exporter has beensubstituted.    use KinoSearch::Util::ToolSet;... is effectively an alias for...    use bytes; no bytes;    use Carp qw( carp croak cluck confess );    use Scalar::Util qw(                          refaddr                         blessed                          dualvar                          isweak                          refaddr                          reftype                          tainted                          weaken                          isvstring                          looks_like_number                          );    use KinoSearch qw( K_DEBUG kdump );    use KinoSearch::Util::VerifyArgs qw( verify_args a_isa_b );    use KinoSearch::Util::MathUtils qw( ceil );Two issues deserve special attention.First, the C<use bytes; no bytes;> combo ensures that subroutines within thebytes:: namespace, such as bytes::length, will be available, while stillkeeping character semantics enabled by default -- so regexes work as expected,etc.Second, the C<use KinoSearch> line does a LOT more than it appears to atfirst glance -- it loads ALL of the XS routines in the entire KinoSearchsuite.  See L<KinoSearch::Docs::DevGuide|KinoSearch::Docs::DevGuide> for anexplanation.=head1 COPYRIGHTCopyright 2005-2007 Marvin Humphrey=head1 LICENSE, DISCLAIMER, BUGS, etc.See L<KinoSearch|KinoSearch> version 0.163.=cut

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?