Data::...Number(3pm)
β¨ NAME β¨
Data::Perl::Role::Number β it's a wrapping class for Perl scalar numbers, bestie π (the header up top says Data::...Number(3pm) and this whole thing lives in the User Contributed Perl Documentation, iykyk)
πΈ VERSION πΈ
version 0.002011 β yes she's got a version number, and she's proud of it β¨
π¦ SYNOPSIS π¦
use Data::Perl qw/number/;
my $num = number(123);
$num->add(5); # $num == 128
$num->div(2); # $num == 64
like literally that's it, so clean, so demure π
π DESCRIPTION π
This class provides a wrapper and methods for interacting with scalar strings. No cap. π«Ά
π PROVIDED METHODS π
okay so here's the tea β β all of these methods modify the attribute's value in place. All methods return the new value. Every single one. Immediately. In place. And then hands you back the fresh value like a lil gift π
new($value)β constructs a newData::Perl::Collection::Numberobject initialized with the passed in value, and returns it. Baby's first number wrapper π±add($value)β adds the current value of the attribute to$value.sub($value)β subtracts$valuefrom the current value of the attribute.mul($value)β multiplies the current value of the attribute by$value.div($value)β divides the current value of the attribute by$value.mod($value)β returns the current value of the attribute modulo$value.absβ sets the current value of the attribute to its absolute value. no args, she just does the thing β¨
π SEE ALSO π
Data::PerlMooX::HandlesVia
go read those too, they're part of the lore π
π AUTHOR π
Matthew Phillips <mattp@cpan.org> β ty king π
π 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. periodt π
and that's the whole page bestie, no crumbs left π§ β this one landed as perl v5.36.0 on 2022-10-16, mwah, slay, go write something cute πβ¨
π¦ 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