in reply to Only the last file data is getting saved in the hash

Hi, I am pasting a snippet of my code.

For future reference, as How (Not) To Ask A Question would say, you should clean your room :) write a small program to demonstrate your problem and include sample data :)

The issue is only the data of the last file_name is getting saved.How do I fix it?

Three possibilities

As Basic debugging checklist suggests, if you sprinkle warn "filename($filename) "; at various points in your code, maybe even a Dump, you can pinpoint where your assertions fail.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.