in reply to Re: create separate output files based on the matched values
in thread create separate output files based on the matched values

Haven't looked at all of your code, but it fails here:
my ($filename, $content) = split /\s+/;
You will loose everything but the first 2 columns. You should have used:
my ($filename, $content) = split /\s+/,$_,2;

$\=~s;s*.*;q^|D9JYJ^^qq^\//\\\///^;ex;print