9 |
use base qw/WebPAC::Common/; |
use base qw/WebPAC::Common/; |
10 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
11 |
use Encode qw/decode from_to/; |
use Encode qw/decode from_to/; |
12 |
|
use YAML; |
13 |
|
|
14 |
=head1 NAME |
=head1 NAME |
15 |
|
|
297 |
$log->debug("-=> $f_nr ## $l"); |
$log->debug("-=> $f_nr ## $l"); |
298 |
|
|
299 |
# codepage conversion and recode_regex |
# codepage conversion and recode_regex |
300 |
# $l = decode($input_encoding, $l, 1); |
$l = decode($input_encoding, $l, 1); |
|
from_to( $l, $input_encoding, 'utf-8', 1 ); |
|
301 |
$l =~ s/($recode_regex)/$recode_map->{$1}/g if ($recode_regex && $recode_map); |
$l =~ s/($recode_regex)/$recode_map->{$1}/g if ($recode_regex && $recode_map); |
302 |
|
|
303 |
# apply regexps |
# apply regexps |
316 |
warn "*** $d\n" if ($debug); |
warn "*** $d\n" if ($debug); |
317 |
|
|
318 |
} |
} |
319 |
$log->error("error applying regex: $r") if ($@); |
$log->error("error applying regex: ",dump($r), $@) if $@; |
320 |
} |
} |
321 |
} |
} |
322 |
|
|
562 |
|
|
563 |
$log->debug( sub { dump($s) } ); |
$log->debug( sub { dump($s) } ); |
564 |
|
|
565 |
|
my $path = 'var/stats.yml'; |
566 |
|
YAML::DumpFile( $path, $s ); |
567 |
|
$log->info( 'created ', $path, ' with ', -s $path, ' bytes' ); |
568 |
|
|
569 |
return $out; |
return $out; |
570 |
} |
} |
571 |
|
|
724 |
line => $., |
line => $., |
725 |
}; |
}; |
726 |
$log->debug("regex: $regex"); |
$log->debug("regex: $regex"); |
727 |
|
} else { |
728 |
|
die "can't parse: $_"; |
729 |
} |
} |
730 |
} |
} |
731 |
|
|