in reply to Finding Files and Processing them iteratively
You don't necessarily need to glob both filename patterns, as you may not be that worried about detecting problems with the dataset itself. I think I would want to validate this, though. I'd want to know if there were more or fewer data*R.fa vs data*P.fa files, or if the number is the same, but the names themselves didn't match up. You can use List::Compare to find out if the two arrays are the same.# All "R" data files my @data_r = glob "*R.fa"; # All "P" data files my @data_p = glob "*P.fa";
You can get the base datafile names like this:
From there it is pretty easy to open and process each set of files (data#R.fa, data#P.fa) iteratively.my @base_data = map substr($_, 0, length($_) - 4), @data_r;
|
|---|