| 1 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | package Test::DiagRef; | ||||||||||
| 4 | { | ||||||||||
| 5 | 1 | $Test::DiagRef::VERSION = '1.132080'; | |||||||||
| 6 | } | ||||||||||
| 7 | # ABSTRACT: detailed diagnostics for your reference tracking tests | ||||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | use Exporter 5.57 'import'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | our @EXPORT = 'diag_ref'; | |||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | use Test::More (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 1 | *diag = \&Test::More::diag; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | sub diag_ref ($) | ||||||||||
| 19 | 0 | ▶ | { | ||||||||
|
Subroutine
diag_ref: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 20 | 0 | my $ref = shift; | |||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | return unless defined $ref; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | unless (ref $ref) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 0 | diag 'value is a scalar'; | |||||||||
| 26 | return | ||||||||||
| 27 | 0 | } | |||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | if (eval { require Devel::FindRef }) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | diag Devel::FindRef::track($ref) | |||||||||
| 31 | } else { | ||||||||||
| 32 | 0 | diag '(Install Devel::FindRef for a detailed report)' | |||||||||
| 33 | } | ||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 1 | 1; | |||||||||
| 37 | __END__ | ||||||||||