Test2::Util::Ref(3pm)

πŸŽ€ Test2::Util::Ref(3pm) β€” Perl Programmers Reference Guide πŸŽ€

okay so this is the glow-up of Test2::Util::Ref, and it’s literally about tools for inspecting or manipulating references. bestie, if you’re in Test2::Tools land, these little helpers are your new faves. πŸ’…βœ¨

πŸ’– NAME πŸ’–

Test2::Util::Ref β€” Tools for inspecting or manipulating references. 🫢

🌸 DESCRIPTION 🌸

They’re used by Test2::Tools to inspect, render, or manipulate references. no cap, that’s the whole vibe. πŸ¦‹

✨ EXPORTS ✨

All exports are optional. You must specify subs to import. (Iconic β€œopt-in only” behavior, honestly. πŸ’…)

  • $type = rtype($ref) β€” a normalization between Scalar::Util::reftype() and ref(). It always returns a string. Returns 'REGEXP' for regex types. Returns '' for non-refs. Otherwise returns what Scalar::Util::reftype() returns. slay. ✨
  • $addr_str = render_ref($ref) β€” always returns a string. For unblessed references this returns something like "SCALAR(0x...)". For blessed references it returns "My::Thing=SCALAR(0x...)". The only difference between this and $add_str = "$thing" is that it ignores any overloading to ensure it is always the ref address. literally the β€œjust give me the address” button. πŸ”₯

πŸ¦‹ SOURCE πŸ¦‹

The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/. go off, repo. 🫢

πŸ‘‘ MAINTAINERS πŸ‘‘

  • Chad Granum <exodist@cpan.org>

🧚 AUTHORS 🧚

  • Chad Granum <exodist@cpan.org>
  • Kent Fredric <kentnl@cpan.org>

Copyright Chad Granum <exodist@cpan.org>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://dev.perl.org/licenses/.


byeeee bestie, and here’s the footer vibe: perl v5.42.3, 2026-11-03, Test2::Util::Ref(3pm). πŸ’–πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from