1Test2::Util::Ref(3) User Contributed Perl Documentation Test2::Util::Ref(3)
2
3
4
6 Test2::Util::Ref - Tools for inspecting or manipulating references.
7
9 These are used by Test2::Tools to inspect, render, or manipulate
10 references.
11
13 All exports are optional. You must specify subs to import.
14
15 $type = rtype($ref)
16 A normalization between "Scalar::Util::reftype()" and "ref()".
17
18 Always returns a string.
19
20 Returns 'REGEXP' for regex types
21
22 Returns '' for non-refs
23
24 Otherwise returns what "Scalar::Util::reftype()" returns.
25
26 $addr_str = render_ref($ref)
27 Always returns a string. For unblessed references this returns
28 something like "SCALAR(0x...)". For blessed references it returns
29 "My::Thing=SCALAR(0x...)". The only difference between this and
30 "$add_str = "$thing"" is that it ignores any overloading to ensure
31 it is always the ref address.
32
34 The source code repository for Test2-Suite can be found at
35 https://github.com/Test-More/Test2-Suite/.
36
38 Chad Granum <exodist@cpan.org>
39
41 Chad Granum <exodist@cpan.org>
42 Kent Fredric <kentnl@cpan.org>
43
45 Copyright 2018 Chad Granum <exodist@cpan.org>.
46
47 This program is free software; you can redistribute it and/or modify it
48 under the same terms as Perl itself.
49
50 See http://dev.perl.org/licenses/
51
52
53
54perl v5.36.0 2022-07-22 Test2::Util::Ref(3)