#!/usr/bin/perl require "/home/dast/perl/date.pm"; opendir(DIR, ".") or die "Can't opendir()"; @logs = grep { /^rockbox-/ } readdir(DIR); closedir DIR; print "\n"; $lasty = 0; $lastm = 0; $count = 0; for ( sort @logs ) { $size = (stat("$_"))[7]; $file = $_; $log = ""; if (/-(\d+)/) { if ( $1 =~ /(\d\d\d\d)(\d\d)(\d\d)/ ) { $y = $1; $m = $2; $d = $3; $mname = ucfirst MonthNameEng($m); if ($y != $lasty) { if ($lasty != 0) { print "\n"; } print "\n"; $lasty = $y; } else { print "\n" if ( $m != $lastm ); } if ( $m != $lastm ) { $count=0; print "\n"; $lastm = $m; } print "\n"; if ( ++$count > 15 ) { print "\n"; $count=0; } } } } print "

$y
$mname$d
\n";