in reply to Perl Script to create sample files in each directories created.

G'day rahul_lfo,

Welcome to the monastery.

"The script I am using to create directories is given below.What is need is that these directories should have a sample data like .png files in it---"

You can use the builtin module File::Copy to copy (or move) the sample data into the directories you create.

The code you posted is incomplete and won't work, which you would have found out had you run it. What's "open(DIR, ">>contacts".$i.".json");" supposed to do? Where you aware that "$i" has not been declared or assigned a value? Did you have a question about this? The guidelines in "How do I post a question effectively?" may help you: a better question will get you better answers.

-- Ken