| 1 | package Common::Log::Parser; | ||
| 2 | |||
| 3 | # ABSTRACT: Parse the common log format lines used by Apache | ||
| 4 | |||
| 5 | 1 | ▶ | use v5.20; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | ▶ | use Exporter 5.57 qw( import ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | our $VERSION = 'v0.2.0'; | |
| 11 | |||
| 12 | 1 | our @EXPORT_OK = qw( split_log_line ); | |
| 13 | |||
| 14 | 1 | ▶ | use experimental qw( signatures ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | |||
| 17 | 5 | ▶ | sub split_log_line ($line) { |
|
Subroutine
split_log_line: called CC=1 SCAR=0.0
Pod
documented
| |||
| 18 | |||
| 19 | |||
| 20 | 5 | my @matches = $line =~ /(?: \A | [ ]) ( - | \[ [^]]+ \] | " (?:\\.|[^"])* " | \S+ ) /agx; | |
| 21 | 5 | return \@matches; | |
| 22 | } | ||
| 23 | |||
| 24 | 1 | 1; | |
| 25 | |||
| 26 | __END__ | ||