Check File::Basename. It can return the path and the filename.
In reply to Re: URL Help by myocom in thread Removing filename from directory paths (was: URL Help) by vbrtrmn