#!/usr/bin/perl

use 5.010;
# use blib;
use List::MoreUtils;
use Devel::Peek;

my @files = qw< foo bar baz qux >;
my @groups = List::MoreUtils::part (
    sub {
        given ($_) {
            when ('foo') { return 0 }
            when ('bar') { return 1 } 
            when ('baz') { return 2 }
            when ('qux') { return 3 }
        }
    },
    @files,
);
Dump \@files;
say STDERR '---';
Dump \@groups;
