in reply to need to create blank file in directory

If you are going through the loop, it's either creating the file or throwing an error for each element. You didn't mention an error; only that the file is not created. This suggests that there is nothing in the loop. What is the output of the line before the loop that prints the elements of @list ?

Also, as hippo pointed out, you are initializing the hash inside the loop so there is no way any key can exist in it, and it won;t be available outside the for loop.

Maybe take a step back and describe what you are generally trying to accomplish - there may be a better way. For example, you probably should use Text::CSV for reading in comma-separated data.

Hope this helps!


The way forward always starts with a minimal test.