open my $filelist, '>', $filelist or die "Can't open $filelist: $!";