#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @array1 = ( "proc1", "proc2", "proc3", "proc4" ); my @array2 = ( "proc1", "proc2", "proc3", "proc4", "proc5" ); my %HoA = ( prebuilds => [@array1], postbuilds => [@array2], ); print Dumper \%HoA; while ( my ( $key, $reference ) = each %HoA ) { foreach my $temp ( @{$reference} ) { print "key: $key, temp: $temp\n"; # look to see if a value in the postbuild list # exists in the prebuild list if ( exists( $HoA{'postbuild'}->$temp ) ) { print "yes\n"; } else { print "no\n"; } } }