Help for this page
unless ('/' eq substr($directory, 0, 1) and '/' eq substr($directory, -1, 1)) { ...