@ARGV = filename.txt; while(<>) { /^(\d)\s+time\s+\d{2}\:\d{2}\:\d{2}\s+(\d+)/; $hash{$1} = $2; }