Export...e::Meta(3pm)
π NAME π
Exporter::Declare::Meta β bestie, this is the meta object that keeps all the receipts (aka meta-data) for every exporter out there. π
β¨ DESCRIPTION β¨
okay so listen. every single class that uses Exporter::Declare gets its own little Meta object assigned to it. it's giving personal assistant energy tbh. π
and what does that Meta object do? it tracks all the available exports, tags, and options. that's it. that's the whole job. no cap. π
π«Ά METHODS π«Ά
$class->new( $package )β creates a meta object for the package you handed over. and the way that it also injects theexport_meta()sub into that package's namespace so it returns the generated meta object?? iconic behaviour honestly. β¨$class->new_from_exporter( $package )β makes a meta object for a package that already usesExporter.pm. heads up bestie, this will not turn the class into anExporter::Declarepackage, but it will create a meta object and anexport_meta()method on it. this one's mainly for reexport purposes. π$package = $meta->package()β gets you the name of the package that this meta object is associated with. simple. clean. slay. πΈ$meta->add_alias()β usually gets called at construction time to add a package alias function to the exports. lowkey a behind-the-scenes girly. π$meta->add_export( $name, $ref )β adds an export.$nameshould be the item name with sigil (and it's assumed to be a sub if there's no sigil, fyi).$refshould be a ref blessed as anExporter::Declare::Exportsubclass. π¦$meta->get_export( $name )β retrieves theExporter::Declare::Exportobject by name.$nameshould be the item name with sigil, and again it's assumed to be sub when the sigil is missing. π«$meta->export_tags_push( $name, @items )β adds@itemsto the specified tag. the tag gets created if it doesn't already exist, no worries.$nameshould be the tag name WITHOUT the-/:prefix. β@list = $meta->export_tags_get( $name )β gets the list of items associated with the specified tag.$nameshould be the tag name WITHOUT the-/:prefix. π@list = $meta->export_tags_list()β gets a list of all the export tags. the whole roster. π$bool = $meta->is_tag( $name )β checks if a tag with the given name exists.$nameshould be the tag name WITHOUT the-/:prefix. yes bestie, the prefix rule again. π$meta->options_add( $name )β adds import options by name. these are boolean options that take no arguments, so don't come for them with extra stuff. π«my @list = $meta->options_list()β gets you the list of options. π$meta->arguments_add( $name )β adds import options that slurp in the next argument as a value. hungry little things fr fr. π$bool = $meta->is_option( $name )β checks if the specified name is an option. π$bool = $meta->is_argument( $name )β checks if the specified name is an option that takes an argument. π$meta->add_parser( $name, sub { ... } )β adds a parser sub that should be associated with exports viaDevel::Declare. π§$meta->get_parser( $name )β gets a parser by name. π―$ref = $meta->get_ref_from_package( $item )β returns a reference to a specific package variable or sub. π$meta->reexport( $package )β re-exports the exports in the provided package. and plot twist,$packagemay be anExporter::Declarebased package or anExporterbased package. versatile queen. π$meta->merge( $meta2 )β merges in the exports and tags of the second meta object. combining forces, bestie. π€
π AUTHORS π
Chad Granum exodist7@gmail.com
π 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.
okay bestie that's the whole page, every last crumb of it, no crumbs left behind π
and for the sign-off: this lil masterpiece is from perl v5.34.0, dated 2022-06-13, and yeah it's the Export...e::Meta(3pm) page, mwah πβ¨ π¦
π¦ 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