#!/usr/bin/perl -w use strict; my @hosts = qw(zeus mercury athena); my (@p_files, @s_files); my %data; for my $host ( @hosts ) { push @p_files , 'passwd.' . $host; push @s_files , 'shadow.' . $host; } # Process /etc/passwd files FILE: for my $file ( @p_files ) { if ( ! open (PASSWD, $file) ) { warn "Unable to open $file : $!"; next FILE; } LINE: while ( ) { my @fields = split /:/; if ( @fields != 7 ) { warn "$_ in file $file is corrupt"; next LINE; } $data{$fields[0]}->{$file} = \@fields; } } # Process /etc/shadow files FILE: for my $file ( @s_files ) { if ( ! open (SHADOW, $file) ) { warn "Unable to open $file : $!"; next FILE; } LINE: while ( ) { # Not sure what to do here # but I know I need to modify # $data{account}->{$file}[1] } } # Need code help here to do all the comparisons I need