in reply to Data Structures Help

You can use a hash of hashes like this:
use strict; my %house; my $room; while (<DATA>) { chomp; next unless $_; # skip blank lines if(/^\D/) { $room = $_ } else { $house{$room}{$_}++ } } foreach my $room (keys %house) { print "$room:\n"; print "width height quantity\n"; map { print "$_ $house{$room}{$_}\n"; } sort { $house{$room}{$b} <=> $house{$room}{$a} } keys %{$house{$room}}; } __DATA__ office 1 120 120 120 120 140 135 155 135 120 120 bedroom 2 100 75 100 75 120 180
Outout:
bedroom 2: width height quantity 100 75 2 120 180 1 office 1: width height quantity 120 120 3 140 135 1 155 135 1