my %ICE = ( 21:31:10 => [ 'Pending=3201', ], 21:32:14 => [ 'Pending=1000', ], 21:32:15 => [ 'Gap detect', '233.156.208.41:20041', 'Pending=214044',], 21:32:24 => [ 'Gap detect', '233.156.208.41:20041', 'Pending=104000',], 21:32:58 => [ 'Gap detect', '233.156.208.41:20041' 'Pending=96000',], 21:33:12 => [ 'Pending=528', ] ); And print comma separated: 21:31:10, Gap detect 233.156.208.41:20041, Pending= 21:31:12, Gap detect 233.156.208.41:20041, Pending=3400