my %hash = ( val1 => 1, val2 => 2, val3 => 3, ); for my $key (keys %hash) { print ",$key:$hash{$key}"; }