in reply to Building data structure from several /etc/passwd files

tux242,
What you are looking for is most likely a Hash of Hashes of Arrays (HoHoA).
Consider the following untested code:
#!/usr/bin/perl -w use strict; use Data::Dumper; my @files = map { 'passwd.server' . $_ } 1 .. 9; my %data; for my $file (@files) { open (PASSWD, $file) or die "Unable to open $file : $!"; while (<PASSWD>) { chomp; my @field = split /:/ , $_; $data{$file}{$field[0]} = \@field } } # Code to manipulate and identify conflicts in %data goes here print Dumper(\%data);
I hope this helps. If I knew what sort of "clean up" you were trying to do, I would have done more.

Cheers - L~R