in reply to how to iterate directory
Here's a guess...
system "cut -opts $_/file >$_/newfile" for qw( d1 d2 d3 d4 d5 );
Of course, change "-opts" to your actual "cut" flags and "file" and "newfile" to your desired file names.
If this is not what you are looking for, a better description of your problem is needed...
In Section
Seekers of Perl Wisdom