#!/usr/local/bin/perl -w use strict; { my %hash = (); while () { my @items = split; $hash {pop @items} = shift @items; } print "key=$_, val=$hash{$_}\n" foreach sort keys (%hash); } __DATA__ 1 time 02:11:05 djw 5 time 04:20:03 bert 2 time 00:01:39 chris