in reply to How to seperate directory and file

You can use basename and dirname functions from "File::Basename" CPAN module to achieve this.