examples/destroyed.plx

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 25 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« examples/copied.plx ↑ Summary examples/global-destruction.plx »
1 #!/usr/bin/env perl
2 1 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Devel::WatchVars;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶sub twice { return 2 * shift }
Subroutine twice: called CC=1 SCAR=0.0
8  
9 {
10 1 my $x = 1;
11 1 watch($x, '$x');
12 1 say "starting watched value is $x";
13 1 $x = 5 + twice(++$x);
14 1 say "ending watched value is $x";
15 1 say "about to go out of scope";
16 }
17  
18 1 say "x is out of scope";
19  
20 __END__
« examples/copied.plx ↑ Summary examples/global-destruction.plx »