like if 1st file is found in while traversing thru dir/sub dir then values will : $dir_names[0]=A2 $dir_names[1]=MIUY $dir_names[2]=CCT $filenames[0]=CCT023 likewise,when 2nd file is found in another sub directory then values will be : $dir_names[0]=A2 $dir_names[1]=MIUY $dir_names[2]=SST $filenames[0]=RETEEYY