Oh I see! I like it! Is there a way to iterate the other way around (from the start of the path to the end instead from the end to the start)? It will be easier to insert the paths into the hash that way.
Also, does it know how to handle with multi-links? For example a/b -> c/d -> e/f? In case it's a link, should I iterate until I get the actual path?