#!/usr/bin/perl -w use strict; my ($x, $y); my %hash; my $key; while () { /(\w.*)\ (\w.*)/; $key = int($1) . ' ' . int($2); $hash{$key}++; } foreach my $item (sort( keys(%hash))) { print $item . ': ' . $hash{$item} . "\n"; } __DATA__ 123.7 456.7 564.7 234.9 123.7 456.7 564.7 234.9 654.9 132.7 518.0 025.3