#!/usr/bin/perl
use warnings;
use strict;
my $file = $ARGV[0] || 'bigfile.dat';
open (INPUT, '<', $file) or die "Unable to open $file for reading : $!";
my %date;
my $pos = tell INPUT;
while ( ) {
my @field = split /\|/;
push @{ $date{ join '', (split m|/|, $field[4])[2,0,1] } }, $pos;
$pos = tell INPUT;
}
for ( sort { $a <=> $b } keys %date ) {
for ( @{ $date{ $_ } } ) {
seek INPUT, $_, 0;
print scalar ;
}
}