Data::...Counter(3pm)
π Data::Perl::Role::Counter β the girlies' guide π
ok so bestie, you're reading the manual page for Data::...Counter(3pm), which is the Perl doc for Data::Perl::Role::Counter β a wrapping class for a simple numeric counter. that's the whole vibe. a number that goes up, a number that goes down, a number that goes back to zero. iconic behaviour honestly. β¨
πΈ VERSION πΈ
version 0.002011</purpose>
(purple tags: use <purple> only. Let me redo.)
πΈ VERSION πΈ
version 0.002011
like, that's the version. lowkey important, no cap.
π SYNOPSIS π
here's the whole energy in four lines, fr fr:
use Data::Perl qw/counter/;
my $c = counter(4);
$c->inc; # $c == 5
$c->reset; # $c == 0
see how it starts at 4, hits 5, and then just casually resets to 0? that's the arc. that's the character development. π
π¦ DESCRIPTION π¦
This class provides a wrapper and methods for a simple numeric counter.
that's it. that's the description. it wraps a number and gives you methods to mess with it. simple, clean, does exactly what it says on the tin. not every module needs to be a whole production. π«Ά
β¨ PROVIDED METHODS β¨
the main characters, in order:
new($value)β Constructs a newData::Perl::Collection::Counterobject initialized with the passed in value, and returns it. give it a number, get a whole object back. glow-up.set($value)β Sets the counter to the specified value and returns the new value. This method requires a single argument. so like, you have to hand it a value. it's not optional, bestie. one argument, that's the rule. βincβ Increases the attribute value by the amount of the argument, or by 1 if no argument is given. This method returns the new value. This method accepts a single argument. πinc($arg)β same thing as above but now you're giving it the argument: increases the attribute value by the amount of the argument, or by 1 if no argument is given. This method returns the new value. This method accepts a single argument.decβ Decreases the attribute value by the amount of the argument, or by 1 if no argument is given. This method returns the new value. This method accepts a single argument. πdec($arg)β Decreases the attribute value by the amount of the argument, or by 1 if no argument is given. This method returns the new value. This method accepts a single argument.resetβ Resets the value stored in this slot to its default value, and returns the new value. the "okay we're starting over, fresh slate, clean girl era" method. π§
ngl theinc/decpairs are listed as separate entries up there because that's literally how the page does it β one without an arg, one with. same method, two signatures. iykyk. don't come for me, i'm just the messenger. π
π₯ SEE ALSO π₯
go read these next, bestie, they're the whole friend group:
Data::PerlMooX::HandlesVia
π AUTHOR π
Matthew Phillips <mattp@cpan.org>
like, credit where credit is due. slay. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
so yeah β free to use, free to share, same terms as Perl 5 itself. go off, king. π
and that's the whole page, bestie!! sign-off time: this was written for perl v5.36.0, dated 2022-10-16, and it lives at Data::...Counter(3pm) in the User Contributed Perl Documentation section. go forth and count. βπΈπ
π¦ where this page comes from
- ubuntu noble: libdata-perl-perl 0.002011-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdata-perl-perl 0.002011-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-perl-perl 0.002011-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