File Coverage

blib/lib/Common/Log/Parser.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 22 22 100.0


line stmt bran cond sub pod time code
1             package Common::Log::Parser;
2              
3             # ABSTRACT: Parse the common log format lines used by Apache
4              
5 1     1   240240 use v5.20;
  1         5  
6 1     1   7 use warnings;
  1         2  
  1         67  
7              
8 1     1   5 use Exporter 5.57 qw( import );
  1         26  
  1         84  
9              
10             our $VERSION = 'v0.2.0';
11              
12             our @EXPORT_OK = qw( split_log_line );
13              
14 1     1   704 use experimental qw( signatures );
  1         5306  
  1         6  
15              
16              
17 5     5 1 285014 sub split_log_line ($line) {
  5         12  
  5         11  
18              
19              
20 5         151 my @matches = $line =~ /(?: \A | [ ]) ( - | \[ [^]]+ \] | " (?:\\.|[^"])* " | \S+ ) /agx;
21 5         94 return \@matches;
22             }
23              
24             1;
25              
26             __END__