--- Joshua Slive <[EMAIL PROTECTED]> wrote: > The relevant code is: > > local($path) = @_; > my($mapped, $dir) = ("", $path); > my(%mapping) = ('apache-2.0/src/include' => 'httpd-docs-2.0', > 'apache-2.0/src/os/unix' => 'httpd-docs-2.0', > 'apache-2.0/src/lib/apr/include' => 'httpd-docs-2.0', > 'httpd-2.0/docs' => 'httpd-docs-2.0'); > > if ($mapped = $mapping{$path}) { > }
Hrm, a substring match is tricky the way it's set up. You'd have to loop through all the keys of %mapping looking for a match, something like this: foreach $mainpath (keys %mapping) { if ($mainpath =~ /^$path/) { $mapped = $mapping{$mainpath}; break; } } __________________________________________________ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/