Specio::Exporter(3)
πΈ NAME πΈ
Specio::Exporter β base class for type libraries. Thatβs the whole name vibe, bestie π
.
β¨ VERSION β¨
This page is serving version 0.49, so lock that in π«Ά.
π SYNOPSIS π
okay so hereβs the whole setup, no cap:
package MyApp::Type::Library;
use parent 'Specio::Exporter';
use Specio::Declare;
declare( ... );
# more types here
package MyApp::Foo;
use MyApp::Type::Library
π DESCRIPTION π
Inheriting from this package makes your package a type exporter. By default, types defined in a package are never visible outside of the package. When you inherit from this package, all the types you define internally become available via exports. slay.
The exported types are available through the importing packageβs t subroutine. iykyk.
By default, types your package imports are not re-exported:
package MyApp::Type::Library;
use parent 'Specio::Exporter';
use Specio::Declare;
use Specio::Library::Builtins;
In this case, the types provided by Specio::Library::Builtins are not exported to packages which use MyApp::Type::Library.
You can explicitly ask for types to be re-exported:
package MyApp::Type::Library;
use parent 'Specio::Exporter';
use Specio::Declare;
use Specio::Library::Builtins -reexport;
In this case, packages which use MyApp::Type::Library will get all the types from Specio::Library::Builtins as well as any types defined in MyApp::Type::Library. iconic behavior, honestly.
π ADDITIONAL EXPORTS π
If you want to export some additional subroutines from a package which has Specio::Exporter as its parent, define a sub named _also_export. This sub should return a list of subroutines defined in your package that should also be exported. These subs will be exported unconditionally to any package that uses your package. periodt.
π¦ COMBINING LIBRARIES WITH Specio::Subs π¦
You can combine loading libraries with subroutine generation using Specio::Subs by using _also_export and Specio::Subs::subs_installed_into:
package My::Library;
use My::Library::Internal -reexport;
use Specio::Library::Builtins -reexport;
use Specio::Subs qw( My::Library::Internal Specio::Library::Builtins );
sub _also_export {
return Specio::Subs::subs_installed_into(__PACKAGE__);
}
β SUPPORT β
Bugs may be submitted at <https://github.com/houseabsolute/Specio/issues>. bestie, if somethingβs cursed, thatβs the spot πβ¨
π₯ SOURCE π₯
The source code repository for Specio can be found at <https://github.com/houseabsolute/Specio>. go peek, itβs giving open source main character energy π
π AUTHOR π
Dave Rolsky <autarch@urth.org>
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2012 - 2024 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
The full text of the license can be found in the LICENSE file included with this distribution.
okay thatβs the whole page, bestie β footer tea β: perl v5.42.0, dated 2024-12-24, and the page is Specio::Exporter(3). byeee, go export those types π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Specio 0.490.0-160000.2.2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms