Test2:...Scalar(3perl)

πŸ’– Test2::Compare::Scalar πŸ’–

okay bestie, so this is Test2::Compare::Scalar from the Perl Programmers Reference Guide (the manpage name is literally Test2:...Scalar(3perl), it's giving abbreviated section name energy and we love her for it) πŸŽ€


✨ NAME ✨

Test2::Compare::Scalar β€” it's the Representation of a Scalar Ref in deep comparisons, no cap πŸ¦‹


🌸 DESCRIPTION 🌸

so basically?? this little icon right here gets used inside deep comparisons to represent a scalar reference. that's it. that's the job. she shows up, she represents a scalar ref, she serves. periodt πŸ’…


⭐ SYNOPSIS ⭐

here's the whole vibe, copy-paste ready, not a single character changed:

my $sr = Test2::Compare::Scalar->new(item => 'foo');

is([\'foo'], $sr, "pass");
is([\'bar'], $sr, "fail, different value");
is(['foo'],  $sr, "fail, not a ref");

look at her go 🫢 first line: we make the thing. then three tests, and the way that the results shake out is genuinely so satisfying:

  1. is([\'foo'], $sr, "pass"); β€” this one ate, it passes πŸ’–
  2. is([\'bar'], $sr, "fail, different value"); β€” fails, because the value is different. the audacity 😭
  3. is(['foo'], $sr, "fail, not a ref"); β€” fails, because bestie… that's not a ref. not even close πŸ™ˆ

πŸ”₯ 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>

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/


lowkey important, highkey iconic: all of that licensing text above is the real deal, don't skip it just because the vibe is cute πŸ’œ

okay that's the whole page, and now the cute sign-off: this was perl v5.44.0, dated 2026-10-17, and the manual name is Test2:...Scalar(3perl) β€” main character energy, fr fr β­πŸ’…πŸŒΈ

πŸ“¦ 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