my @thermos = map { "Thermos$_" } 1..10; my @enthalpy = 11..20; my @entropy = 21..30; my %thermos = map { $thermos[$_] => { enthalpy => $enthalpy[$_], entropy => $entropy[$_] } } 0.. $#thermos; my $i_want = "Thermos3"; if ( exists $thermos{$i_want} ) { print <{enthalpy} Entropy: $thermos{$i_want}->{entropy} STUFF } else { print "Don't have the thermos: $i_want!\n"; } use Data::Dumper; print Dumper \%thermos;