#Declare array as push(@$key, #some values); .. .. #The above code will help me to generate different arrays for multiple variables but it does not help me to create a multi-dimensional array( Note: I cannot use an anonymous array here since i need to reiterate the entire loop over several days to measure performance and i couldnt find a way of pushing elements on to an anonymous array without creating a separate reference for it) 2. #Declare array as push(@{$key[0]}, #some values); .. .. #Alhtough this will help me to get the desired array format , however the most irritating part is that the variable $key is constant ,i.e evn if i iterate it over a loop, only one array ( i.e @key is generated and the reference for all the arrays is the same)