refactor: reduce nesting in Export.pm (#7180)
refactor: reduce nesting in Export.pm (#7180)

* refactor: reduce nesting in Export.pm

Taking the most deeply nested part of Export.pm and putting it into a
seperate function
openfoodfacts/openfoodfacts-server,openfoodfacts/openfoodfacts-server,openfoodfacts/openfoodfacts-server,openfoodfacts/openfoodfacts-server,openfoodfacts/openfoodfacts-server