File Coverage

blib/lib/Eval/LineNumbers.pm
Criterion Covered Total %
statement 12 12 100.0
branch 2 2 100.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 18 19 94.7


line stmt bran cond sub pod time code
1              
2             package Eval::LineNumbers;
3              
4 1     1   132401 use warnings;
  1         2  
  1         53  
5 1     1   6 use strict;
  1         3  
  1         51  
6              
7 1     1   6 use Exporter 5.57 'import';
  1         45  
  1         272  
8             our @EXPORT_OK = qw(eval_line_numbers);
9              
10             our $VERSION = 0.34;
11              
12             sub eval_line_numbers
13             {
14 2 100   2 0 11739 my(undef, $file, $line) = caller(
15             # Optional first arg is the caller level
16             $_[0] =~ /^[0-9]+$/ ? (shift) : 0
17             );
18 2         1035 $line++;
19 2         109 return join('', qq{#line $line "$file"\n}, @_)
20             }
21             1;
22              
23             __END__