in reply to regexp's
Or, in a few less lines...
--Chris
e-mail jcwren
#!/usr/local/bin/perl -w use strict; { my %hash = (); while (<DATA>) { 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
[jcw@linux fs]$ perl q.pl key=bert, val=5 key=chris, val=2 key=djw, val=1 [jcw@linux fs]$
--Chris
In Section
Seekers of Perl Wisdom