$a = "/root/subroot/subsubroot/filename"; $b = dirname $a; $c = basename $a;