in reply to looping logic error while printing output from folder/flie content
"..but problem is everytime it prints first filename and it's folder/basefolder name.."
Reason: Because, the first filename "$filenames[0]" is "hardcore" written in your script i.e &write_output subroutine.
see this
The filename is not changing. Likewise are other variables used in your &write_output subroutine.... <connection type="PuTTY" name="$filenames[0]"> <connection_info><name>$filenames[0]</name> ...
You are simply just calling your &write_output subroutine, again and again.
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
In Section
Seekers of Perl Wisdom