use strict; use warnings; my %dailyRecords; while () { chomp; next if ! length; my @record = split; # Pull out the data fields # Pull out Date and generate a date stamp my @now = reverse ((localtime ($record[1]))[3..5]); my $dateStamp = join '', map {sprintf '%04d', $_} @now; # Append this record to list keyed by date stamp push @{$dailyRecords{$dateStamp}}, [@record]; } for (sort keys %dailyRecords) { print "Day stamp: $_\n"; my @daysRecords = @{$dailyRecords{$_}}; print "@$_\n" for @daysRecords; } __DATA__ 1149621887 1149623161 NG004193@net.NET 3 820 156 17570249 1149621900 1149623197 NG004193@net.NET 1 648 80 00 1149692376 1149694912 NG004193@net.NET 3 7932259 243 85227944 1149695677 1149695693 Sinkbad@net.net 1 49385 0 00