| 1 | package Parse::AccessLogEntry::Accessor; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | our $VERSION = '0.01'; | |||||||||
| 7 | |||||||||||
| 8 | 2 | ▶ | use base qw( Parse::AccessLogEntry Class::Accessor::Fast ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | __PACKAGE__->mk_ro_accessors(qw( | |||||||||
| 10 | host user date time | ||||||||||
| 11 | diffgmt rtype file proto | ||||||||||
| 12 | code bytes refer agent | ||||||||||
| 13 | )); | ||||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 17 | 1 | my $class = shift; | |||||||||
| 18 | 1 | my $self = $class->SUPER::new; | |||||||||
| 19 | |||||||||||
| 20 | 1 | return bless $self; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 1 | ▶ | sub parse { | ||||||||
|
Subroutine
parse: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 24 | 1 | my $self = shift; | |||||||||
| 25 | 1 | ▶ | my $line = shift or die; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | |||||||||||
| 27 | 1 | my $ref = $self->SUPER::parse($line); | |||||||||
| 28 | |||||||||||
| 29 | 1 | ▶ | while (my ($key, $val) = each %{$ref}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 12 | $self->{$key} = $val; | |||||||||
| 31 | } | ||||||||||
| 32 | 1 | return $self; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 2 | 1; | |||||||||
| 36 | __END__ | ||||||||||