my $a = "testA"; my $b = "testB"; my $c = "testC"; my %combined = ( $a => "a=$a", $b => "b=$b", $c => "c=$c" ); my $combined = join ' ', $combined{$a}, $combined{$b}, $combined{$c};