TEST2::COMPARE::REF(3pm)
π NAME π
ok so this is Test2::Compare::Ref(3pm) β your girl from the Perl Programmers Reference Guide β and she does exactly one thing and she does it iconically: ref comparison. literally just comparing refs. that's the whole vibe. π
β¨ DESCRIPTION β¨
so basically, Test2::Compare::Ref gets used to compare two refs when you're doing a deep comparison. that's it. that's the job. she shows up, she checks the refs are the same actual ref, she leaves. no cap. π«Ά
π¦ SYNOPSIS π¦
ok bestie here's the whole thing, verbatim, because I would never do you dirty:
my $ref = {};
my $check = Test2::Compare::Ref->new(input => $ref);
# Passes
is( [$ref], [$check], "The array contains the exact ref we want" );
# Fails, they both may be empty hashes, but we are looking for a specific
# reference.
is( [{}], [$check], "This will fail");
so the first is() passes because likeβ¦ the array literally contains the exact ref we want π the second one fails, and the reason is such a mood: yes, they both may be empty hashes, but we're out here looking for a specific reference, not just any cute empty hash that wanders by. she's not fooled. periodt. π
ngl the second example is the whole point of the class β same-looking is not the same ref, and this check knows the difference.
π₯ SOURCE π₯
you want the source code repository for Test2-Suite? it's right here, go off:
https://github.com/Test-More/test-more/
π MAINTAINERS π
- Chad Granum
<exodist@cpan.org>π
πΈ AUTHORS πΈ
- Chad Granum
<exodist@cpan.org>π
(yes bestie, same person β he's carrying this whole thing on his back, main character energy fr fr π)
β 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/
ok that's the page!! π tiny page, big energy. this is Test2::Compare::Ref(3pm) from the Perl Programmers Reference Guide, shipped as perl v5.42.3 and dated 2026-11-03 β love that for us, now go compare some refs bestie π
ππ¦
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms