in reply to Question about a hash....

How about a HoA structure?

foreach (@lines) { my ($key, $value) = munge($_); next unless defined $value; # Don't bother creating empty hash entr +ies in the first place ;) push @{$hash{$key}}, $value; }
That way, you'll end up with an array of mac addresses under the key "MACADDRESS". (And same with any other data that gets repeated)