while (<>) { if (/^(\w{1})\-(\d{3})\-(\d{1,2})\-(\d{1,2})\s+\((\d+)\)/) { # print "$1, $2, $3, $4, $5\n"; $hash{$1}{$2}{$3}{$4} = $5; } }