my %hash = []; #explicitly create a hash of arrays structure for clarity #### #push your items into the array - this will create the hash $userid if it dosent already exist push @{$hash{$userid}}, ($title, $adjst, $adjst2, @{$linex}) #@{$linex) says i am a list