Number...nstant(3pm)

πŸ“¦
version 1.710 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Number::Tolerant::Constant β€” a blessed constant type πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation set, filed under Number...nstant(3pm) (the man name is truncated, it's giving ✨abbreviated✨, the real one is Number::Tolerant::Constant). Let's get into it 🫢


✨ VERSION ✨

version 1.710 β€” that's the one, no cap 🌸


🌈 SYNOPSIS 🌈

use Number::Tolerant;
use Number::Tolerant::Constant;

my $range  = tolerance(10);
ref $range; # "Number::Tolerant" -- w/o ::Constant, would be undef

so like. without ::Constant that ref would be undef 😭 with it? you get a whole "Number::Tolerant" object. iconic behavior, honestly πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

Here's the tea β˜• When Number::Tolerant is about to hand you back a tolerance that has zero variation, it doesn't give you a tolerance β€” it gives you a constant instead. Rude? A little. But this module is the fix πŸ’–

This module registers a constant type that catches those constants and returns them as Number::Tolerant objects instead. so like. the constant gets scooped up and reblessed into something you can actually use πŸŽ€

and why did the author even write this? literally to make tolerances play nice with Class::DBI β€” because Class::DBI would otherwise be like "um excuse me, the constructor did not return a blessed object???" πŸ™ˆ and complain. so yeah, this whole module exists to stop that complaint. main character problem-solving energy fr fr ✨


🧚 PERL VERSION 🧚

ngl this part is lowkey wholesome πŸ₯Ή This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years.

okay but real talk β€” even though it may work on older versions of perl, there's no guarantee that the minimum required version won't get raised. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so don't come for them about it πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

Ricardo Signes <cpan@semiotic.systems> 🫢


This software is copyright (c) 2004 by Ricardo Signes.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, legally speaking πŸ’œ


and that's the whole page bestie, you ate that reading assignment πŸ’…βœ¨

cute little sign-off: this was rendered from perl v5.36.0, dated 2023-01-08, and filed under that truncated Number...nstant(3pm) name we mentioned at the top πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from