Export...:Specs(3pm)
π NAME π
ok so bestie, this is Exporter::Declare::Specs β the import argument parser for Exporter::Declare. it's a Perl manual page, section 3pm, and it's literally the lil genius that reads your use line and figures out what you actually meant π
β¨ DESCRIPTION β¨
ngl, import arguments can get messy. here's the tea: every single argument is assumed to be an export unless it's got a - or a : prefix in front of it. and that prefix? it could mean a tag, a boolean option, or an option that takes the next argument as its value. oh and also β almost all of these can be negated with the ! prefix. iconic behavior fr π
this class's whole job is parsing the import arguments and generating the data structures that let the exporter find out what it needs to know. it's giving backstage crew energy π¦
πΈ METHODS πΈ
$class->new( $package, @args )β make a brand new instance and parse@args. yes that's it, that's the vibe β¨$specs->package()β get the name of the package that's supposed to be doing the exporting. like, who's the main character here π$hashref = $specs->config()β get the configuration hash. all the specified options and tags are the keys π the value is true/false/undef for tags and boolean options. for options that take arguments, the value is that argument. and when a config hash gets provided to a tag, that hash is the value. periodt π@names = $specs->arguments()@names = $specs->options()@names = $specs->tags()β get the argument, option, or tag names that were specified for the import. three lil methods, one shared mission π«Ά$hashref = $specs->argument_info()β get the arguments that were specified for the import. the key is the name of the argument, and the value is whatever the user supplied during import π$hashref = $specs->option_info()β get the options that were specified for the import. the key is the name of the user supplied option, and the value will evaluate to true β$hashref = $specs->tag_info()β get the values associated with the tags used during import. the key is the name of the tag, and the value is an array ref containing the values given toexport_tag()for the associated name. nested but make it fashion π$hashref = $specs->exports()β get the exports hash. the keys are the names of the exports. the values are an array containing the export, the item specific config hash, and the arguments array. > heads up bestie: this is generally not intended for direct consumption π$arrayref = $specs->excludes()β get the arrayref containing the names of all the excluded exports. bye felicia π$specs->export( $package )β do the actual exporting. all the exports get injected straight into$package. this is the moment, the slay, the grand finale π₯$specs->add_export( $name, $value )$specs->add_export( $name, $value, \%config )β add an export. name is required, sigil included, no skipping it. value is required too β if it's a sub it gets blessed as a::Sub, otherwise it gets blessed as a::Variable. look how cute that is:
$specs->add_export( '&foo' => sub { return 'foo' });
π AUTHORS π
Chad Granum β exodist7@gmail.com β thank you for your service π«‘
β COPYRIGHT β
Copyright (C) 2010 Chad Granum
Exporter-Declare is free software; Standard perl licence.
Exporter-Declare is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. (yes bestie, the ALL CAPS is load-bearing, do not remove it π)
ok that's the whole page, you ate it, you understood it, you're literally a Perl girlie now π
β¨ this was perl v5.34.0, dated 2022-06-13 β mwah, take care of her, she's vintage ππ¦
π¦ where this page comes from
- debian bookworm: libexporter-declare-perl 0.114-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libexporter-declare-perl 0.114-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libexporter-declare-perl 0.114-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libexporter-declare-perl 0.114-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libexporter-declare-perl 0.114-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms