File Coverage

lib/Perlmazing/Perlmazing/Precompile/eval_string.pm
Criterion Covered Total %
statement 13 14 92.8
branch 6 8 75.0
condition n/a
subroutine 1 1 100.0
pod n/a
total 20 23 86.9


line stmt bran cond sub pod time code
1             sub main ($) {
2 3     3   1987 my @call = caller;
3 3         8 my $line = $call[2] - 1;
4 3         11 my $header = qq[# line $call[2] "$call[1]"\n];
5 3         7 my @r;
6             my $e;
7             {
8 3         6 local $@;
  3         4  
9 3 50       9 if (wantarray) {
10 0         0 $r[0] = eval $_[0];
11             } else {
12 3         211 @r = eval $_[0];
13             }
14 3 100       23 if ($@) {
15 2         14 $e = $@;
16 2         10 $e .= "...called in eval_string at $call[1] line $call[2].";
17             }
18             }
19 3 100       11 $@ = $e if $e;
20 3 50       13 return wantarray ? @r : $r[0];
21             }