TAP::Object(3pm)
π TAP::Object β the manual page, but make it make sense
ok so this is TAP::Object, from the Perl Programmers Reference Guide β it's the base class that hands all the "TAP::*" modules their shared functionality β¨ like, it's the mom friend of the TAP namespace, no cap.
πΈ VERSION
Version 3.50 π
β¨ SYNOPSIS β¨
package TAP::Whatever;
use strict;
use base 'TAP::Object';
# new() implementation by TAP::Object
sub _initialize {
my ( $self, @args) = @_;
# initialize your object
return $self;
}
# ... later ...
my $obj = TAP::Whatever->new(@args);
see that? you inherit, you write one _initialize, and the constructor is literally just handed to you. slay. π
π DESCRIPTION
"TAP::Object" gives you a default constructor and an exception model for every single "TAP::*" class in the family π«Ά. Exceptions get raised using Carp. that's the whole vibe β consistent construction, consistent erroring, no reinventing the wheel every time, periodt.
π METHODS π
π Class Methods
"new"β creates a brand-new object, bestie π«. anything you hand to"new"gets passed straight along to the"_initialize"method. returns a new object. that's it, that's the method.
π¦ Instance Methods
"_initialize"β initializes a new object π§. heads up: this method is a stub by default, so you're supposed to override it with whatever your little heart needs.
β οΈ Note:"new"expects you to return$selfor raise an exception. no third option, iykyk. see"_croak"andCarp.
"_croak"β raises an exception using"croak"fromCarpπ₯, like:
$self->_croak( 'why me?', 'aaarrgh!' );
it can also be called as a class method, which honestly? iconic:
$class->_croak( 'this works too' );
"_confess"β raises an exception using"confess"fromCarpπ, like:
$self->_confess( 'why me?', 'aaarrgh!' );
and yes, class method energy works here too:
$class->_confess( 'this works too' );
"_construct"β creates a new instance of the specified class β."mk_methods"β creates simple getter/setters πΈ:
__PACKAGE__->mk_methods(@method_names);
that's the whole page, bestie β every method accounted for, nothing missing, we ate and left no crumbs π
kisses and good vibes from perl v5.42.3, dated 2026-11-03 β this has been TAP::Object(3pm), mwah π
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms