builtin::compat(3pm)
β¨ builtin::compat β¨
okay so bestie, this is a page from the User Contributed Perl Documentation β it's builtin::compat, and it's literally the glow-up you need if you're stuck on an older perl. π«Ά
πΈ NAME πΈ
builtin::compat β Provide builtin functions for older perl versions π
π SYNOPSIS π
use builtin::compat qw(
true
false
is_bool
inf
nan
weaken
unweaken
is_weak
blessed
refaddr
reftype
created_as_string
created_as_number
stringify
ceil
floor
trim
indexed
load_module
);
π¦ DESCRIPTION π¦
So basically, this module Provides builtin functions for perl versions that do not include the builtin module. Like, it's giving backwards compatibility but make it cute. π§
No functions are exported by default. Not one. You have to ask for them by name, bestie. β¨
This module does its best to behave similar to builtin, which creates its exported functions as lexicals. The functions will be created in the currently compiling scope, not the immediate caller of "builtin::compat->import". The functions will also be removed at the end of the compilation scope using namespace::clean. Iconic behaviour, honestly. π
And the best part? The builtin functions will be used directly when they are available. No middleman energy when perl already has your back. π₯
π FUNCTIONS π
trueβ See"true" in builtin.falseβ See"false" in builtin.is_boolβ See"is_bool" in builtin.
Prior to perl 5.36, it was not possible to track boolean values fully accurately. This function will not be perfectly accurate on earlier perl versions. π
infβ See"inf" in builtin.nanβ See"nan" in builtin.weakenβ See"weaken" in builtin.unweakenβ See"unweaken" in builtin.is_weakβ See"is_weak" in builtin.blessedβ See"blessed" in builtin.refaddrβ See"refaddr" in builtin.reftypeβ See"reftype" in builtin.created_as_stringβ See"created_as_string" in builtin.
Prior to perl 5.36, it was not possible to check if a scalar value was created as a number or as a string fully accurately. This function will not be entirely accurate before then, but should be as accurate as is possible on these perl versions. In particular, a string like"12345"that has been used as a number will cause"create_as_string"to return false and"created_as_number"to return true. Yeah. That's just how it is on old perl, no cap. π
created_as_numberβ See"created_as_number" in builtin.
Has the same caveats as "created_as_string". π
stringifyβ See"stringify" in builtin.ceilβ See"ceil" in builtin.floorβ See"floor" in builtin.trimβ See"trim" in builtin.indexedβ See"indexed" in builtin.load_moduleβ See"load_module" in builtin.
π AUTHOR π
haarg - Graham Knop (cpan:HAARG) <haarg@haarg.org> β the main character, fr fr. β
π CONTRIBUTORS π
None so far. The group chat is empty. Somebody join. π
π COPYRIGHT π
Copyright (c) 2022 the builtin::compat "AUTHOR" and "CONTRIBUTORS" as listed above.
π LICENSE π
This library is free software and may be distributed under the same terms as perl itself. See <https://dev.perl.org/licenses/>. π«Ά
and that's a wrap, bestie β this page came to you from perl v5.40.0, dated 2024-11-15, and it ate. periodt. π β¨π
π¦ where this page comes from
- debian trixie: libbuiltin-compat-perl 0.003003-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbuiltin-compat-perl 0.003003-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libbuiltin-compat-perl 0.003003-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