Gaim-Log-Parser
view release on metacpan or search on metacpan
lib/Gaim/Log/Parser.pm view on Meta::CPAN
}
my($time, $date, $msg, $day, $month, $year);
# Valid line?
if($line =~ /$line_match_with_time/) {
$time = $1;
$msg = $2;
} elsif($line =~ /$line_match_with_date_and_time/) {
$date = $1;
($month, $day, $year) = split m#/#, $date;
$time = $2;
$msg = $3;
} elsif($line =~ /$line_match_with_euro_date_and_time/) {
$date = $1;
($day, $month, $year) = split m#\.#, $date;
$time = $2;
$msg = $3;
} elsif($line =~ /$line_match_with_iso_date_and_time/) {
$date = $1;
($year, $month, $day) = split m#-#, $date;
$time = $2;
$msg = $3;
} else {
while(defined $line and $line !~ /$line_match/) {
chomp $line;
LOGWARN "Format error in $self->{file}: ",
"Line '$line' doesn't match $line_match";
$line = <$fh>;
}
}
( run in 1.962 second using v1.01-cache-2.11-cpan-71847e10f99 )