I didn't think that was obfuscatory at all, and actually I thought your first example was clearer than the second. On second glance I couldn't help but notice the split, substitute, split and thought of another way to make this a bit clearer still. Untested, I don't have the input data handy:
foreach (@in) {
next unless m!(.*?) # Count
\s+
($in_prefix)?
(([^/]+)/ # campaign
([^/]+)/ # month
([^/]+))!x; # fname
$_ = { campaign => $4,
month => $5,
file => $3,
count => $1,
sort => "$4:$5:$6" };
}
I probably blew the regex but you get the idea. :)