use Cwd; sub loadCache { open $in, "<", "__cache__" or die "Can't open __cache__, $!"; while (<$in>) { chomp; my ($key, @locations) = split /:/; my($file,$checksum) = split /\x1c/, $key; my $rfile = lc($file); push @{$all{$checksum}}, @locations; } } loadCache(); for $k (keys %all) { $t = join(" ", @{$all{$k}}); print $#{$all{$k}} + 1, " ", length($t), " ", $t, "\n"; }