my @data = [ mykey1 => {firstkey => 'firstvalue', secondkey => 'secondval' }, mykey2 => {ninza => 'turtle', 'Hurricane' => 'Dennis'}, mykey3 => [ [one,two, three] ], mykey4 => [ [4, 5, three], [6, 7, four], [8, 9, five] ], ]; for( @{$data[0]} ){ ref or print "$_ => " and next; ref eq 'SCALAR' and print $$_ and next; ref eq 'HASH' and print join( ',', values %$_ ), $/; ref eq 'ARRAY' and do { for( @{$_} ){ print join( ',', split( '\s', "@$_ " )) } print $/ }; }