my %path; $path{$_}=$path{$_} || 1 + keys %path for split /$sep/,$path;