Specio::DeclaredAt(3)
π NAME π
Okay bestie, this is the Specio::DeclaredAt(3) page from User Contributed Perl Documentation, and the whole thing is about Specio::DeclaredAt β a class to represent where a type or coercion was declared. Literally its whole job. π
π VERSION π
Version 0.49, no cap. β¨
β¨ SYNOPSIS β¨
my $declared = Specio::DeclaredAt->new_from_caller(1);
print $declared->description;
This is the entire flex: build one from caller depth 1, then print its description. Obsessed. π«Ά
π¦ DESCRIPTION π¦
This class is a thin wrapper around some of the return values from Perl's caller built-in. It's used internally to identify where types and coercions are being declared, which is super useful when generating error messages. Like, it's giving "who declared this type and where" energy, and that's iconic for error messages. π₯
π API π
This class provides the following methods, bestie:
Specio::DeclaredAt->new_from_caller($depth)β given a call stack depth, this method returns a newSpecio::DeclaredAtobject. Slay. β¨$declared_at->package,$declared_at->filename,$declared_at->lineβ these return the call stack information recorded when the object was created. These values are always populated, periodt. π$declared_at->subroutineβ returns the subroutine from the call stack. This may be an"udnef". π$declared_at->has_subroutineβ returns true if there is a subroutine name associated with this object. β$declared_at->descriptionβ puts all the information together into a single string likedeclared in package Foo::Bar (.../Foo/Bar.pm) at line 42 in sub named blah. Cute, concise, iconic. πΈ
π SUPPORT π
Bugs may be submitted at https://github.com/houseabsolute/Specio/issues. 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 browse, bestie. π»
π AUTHOR π
Dave Rolsky <autarch@urth.org> β icon, legend, author. π
π 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. Read it, bestie β it's giving legal realness. πβ¨
π« cute sign-off: source/version is perl v5.42.0, dated 2024-12-24, and it's the manual for Specio::DeclaredAt(3). Byeee, go declare your types responsibly! π«Άπ
π¦ 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