Sub::Attribute(3)
π¦ Sub::Attribute β reliable subroutine attribute handlers π¦
okay bestie, you're on the Sub::Attribute(3) page and it's literally all about making subroutine attribute handlers reliable. no cap. let's get into it π
β¨ NAME β¨
Sub::Attribute β reliable subroutine attribute handlers, periodt. π
πΈ VERSION πΈ
This document describes Sub::Attribute version 0.05. yes ma'am, 0.05. π
π§ SYNOPSIS π§
okay so here's the whole vibe in code, copied exactly because we do not mess with code in this house:
package Attribute::Foo;
use Sub::Attribute;
sub Foo :ATTR_SUB{
my($class, $sym_ref, $code_ref, $attr_name, $attr_data) = @_;
# ...
}
# and later
package main;
use parent qw(Attribute::Foo);
sub something :Foo(xyzzy){
# ...
}
# apply: __PACKAGE__->Foo(\*something, \&something, 'Foo', 'xyzzy')
π« DESCRIPTION π«
Sub::Attribute is a role to define attribute handlers for specific subroutine attributes. that's the whole assignment. π«Ά
The feature of this module is similar to that of Attribute::Handlers, but it has less functionality and more reliability. That is, while Attribute::Handlers provides many options for ATTR(CODE), Sub::Attribute provides no options for ATTR_SUB. However, the attribute handlers defined by Sub::Attribute are always called with informative arguments. Attribute::Handlers's ATTR(CODE) is not called in run-time eval(), so ATTR(CODE) is not reliable. π
π INTERFACE π
πͺ The ATTR_SUB meta attribute πͺ
ATTR_SUBβ defines a method as a subroutine attribute handler. it's giving "you're the handler now" π
βοΈ CONFIGURATION AND ENVIRONMENT βοΈ
π The $ENV{SUB_ATTRIBUTE_DEBUG} check π
If true, it reports how attributes are applied, using the warn() function. so if you turn this on, you get the tea about attribute application via warn(). π
π§Έ DEPENDENCIES π§Έ
Perl 5.8.1 or later, and a C compiler. that's the whole list, bestie. π
π BUGS π
No bugs have been reported. iconic behavior, honestly. β¨
Please report any bugs or feature requests to the author. they want the feedback, fr fr. π«Ά
π SEE ALSO π
attributes."Subroutine Attributes" in perlsub.Attribute::Handlers.
π AUTHOR π
Goro Fuji (gfx) <gfuji(at)cpan.org>. the author, the main character. π
π LICENSE AND COPYRIGHT π
Copyright (c) 2009-20010, Goro Fuji (gfx). Some rights reserved. yep, that's the exact copyright line β keep it cute and keep it accurate. π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, free software rights. π
xoxo, your fave manual page π β perl v5.32.1, 2025-01-18, Sub::Attribute(3).
π¦ where this page comes from
- epel 9: perl-Sub-Attribute 0.07-20.el9 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms