$gah = join(', ', map { "$_ = $hash{$_}" } keys %hash); # or push @gah, "$k = $v" while (my ($k, $v) = each %hash); $gah = join(', ', @gah);