split_collated.pl untested

filter: Statementstmt 0.0% 0 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 25 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use Mojo::File qw/path/;
2 use Mojo::Util qw/dumper/;
3 use strict;
4  
5 $\ = "\n"; $, = "\t";
6  
7 for (map { path($_) } grep { -f } @ARGV) {
8 my $input = $_->slurp;
9  
10 my $files = { grep { $_ } split /#{12,}\n# (.+?)\n#{12,}\n+/, $input };
11  
12 # print dumper $files;
13
14 for (keys $files->%*) {
15 my $output = path($_);
16 $output->dirname->make_path;
17 $output->spew($files->{$_});
18 }
19 }