| Previous | Next
File::BasenameParses a file's path, returning its three component pieces: the path to the file, the file's basename, and the file's extension. For example, for: /usr/local/lib/perl5/SelectSaver.pm the path is /usr/local/lib/perl5, the basename is SelectSaver, and the extension is pm. File::Basename exports the following functions.
basename (fullname[, suffixlist]) Returns the first element of the list that would be produced if you called
dirname (fullname) Returns the directory portion of the input file specification.
fileparse (fullname[, suffixlist]) Divides a file specification into its three parts, returning them in this order: filename, path, suffix. ($name, $path, $suffix) = fileparse($fullname, @suffixlist) The arguments are the same as for
fileparse_set_fstype (os-string) Called before the other routines to select the appropriate file specification syntax for your operating system, to be used in future File::Basename calls. Currently valid values for |