in reply to new directory with sorted files

use File::Copy; mkdir 'WEIGHT' or die $!; for my $file (glob 'ID_*_weight.txt') { copy($file, 'WEIGHT') or die $!; }
(untested)

See mkdir, glob and File::Copy.