$api_results = [ [ "id1", "app_slug1", "app_name_1", "provider_id_1", ..etc.. ], [ "id2", "app_slug2", "app_name_2", "provider_id_2", ..etc.. ], . . . . . . . . . . . . . . . [ "idN", "app_slugN", "app_name_N", "provider_id_N", ..etc.. ] ]; #### # Prepare a handle to an insert statement: $app_insert = $dbh->prepare("INSERT .....blah, blah"); # Fetch each row of data from results while (my $row = shift @$api_results) { # Tell the insert statement to insert the data $app_insert->execute(@$row); } print "Done inserting\n";