This regular expression matches all extraneous slashes in pathnames, that can be removed without altering which file the path name resolves into.
It is intended to be used like so:
# Replace $extraslashregex with the actual regular expression.
my $cleanpath = $path ~= s/$extraslashregex//gmxXr;