fileparse
fileparse (fullname[,suffixlist])
- Divides a file specification into its three parts, returning them in the order: filename, path, suffix.
($name, $path, $suffix) = fileparse($fullname, @suffixlist)
The arguments are the same as forbasename.