#!/usr/bin/perl use strict; use warnings; my $hoa = {a => [1,2], 'b'=>[1,3], c=> [2,0]}; foreach (keys %{$hoa}) { print "\t'$_' => [" . join(',', @{$hoa->{$_}}) . "],\n"; }