# Display content of search while ( $ref = $sth->fetchrow_hashref()) { # $uniqueKey is the column 'user' from the DB. (ie $key is the specific user name) $key = $ref->{$uniqueKey}; # GetSystem uses the user name to get the associated ID number from DB1, and uses that value to get an associated system name from DB2 my $systemKey = GetSystem($key); if (exists $referenceTable{$key}) { if (defined $referenceTable{key} eq $systemKey) { # do i need to do this? } else { push @{$referenceTable{$key}}, $systemKey; } } else { push @{$referenceTable{$key}}, $systemKey; } } my ($k,@v); print ""; print "\n"; # SET UP THE TABLE # EXECUTE THE WHILE LOOP while (($k, $v) = each(%referenceTable)){ print ""; print ""; } print"
UserSystem
".$k.""; foreach (@$v) { print "$_\n"; } print"
\n";