builtin::compat(3pm)

πŸ“¦
version 0.003003 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ 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 (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