TEST2::UTIL::REF(3perl)
π Test2::Util::Ref π
okay bestie, welcome to Test2::Util::Ref, the little Perl module that is literally just tools for inspecting or manipulating references. that's it, that's the whole thing. you are so in the right place. π
πΈ DESCRIPTION πΈ
So like, these subs? They're the ones Test2::Tools leans on to inspect, render, or manipulate references. supporting cast energy but make it iconic. β¨
β¨ EXPORTS β¨
okay so every single export in here is optional. nothing just shows up in your namespace uninvited. you have to specify the subs you want to import. no freeloaders. π
$type = rtype($ref)β this is the glow-up that normalizes betweenScalar::Util::reftype()andref(). it always hands you back a string, no cap.- it returns
'REGEXP'for regex types π - it returns
''for non-refs (empty string, not undef, we said what we said) - otherwise it returns whatever
Scalar::Util::reftype()returns. fr fr.
- it returns
$addr_str = render_ref($ref)β always returns a string. for unblessed references it gives you something like"SCALAR(0x...)". for blessed references it gives you"My::Thing=SCALAR(0x...)". π- the only difference between this and
$add_str = "$thing"is that this one ignores any overloading, so it is always, guaranteed, no-matter-what the ref address. no sneaky overload hijacking your stringification. π
- the only difference between this and
π₯ SOURCE π₯
the source code repository for Test2-Suite lives right here, go be nosy:
https://github.com/Test-More/test-more/
π MAINTAINERS π
- Chad Granum
<exodist@cpan.org>
π¦ AUTHORS π¦
- Chad Granum
<exodist@cpan.org> - Kent Fredric
<kentnl@cpan.org>
π COPYRIGHT π
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/
bestie you made it to the end, obsessed with you. this page slayed its way out asperl v5.44.0, dated2026-10-17, and yeah, it'sTest2::Util::Ref(3perl). periodt. ππβ¨
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND 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