8.95. File::Basename
Parses 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.
Returns the first element of the list that would be produced if you
basename (fullname[, suffixlist])
called fileparse with the same arguments. Provides
compatibility with the Unix basename command.
Takes the following arguments:
- fullname
Input file specification- suffixlist
Optional list containing patterns to be matched against the end of
fullname to find the suffix
Returns the directory portion of the input file specification.
dirname (fullname)
fullname is the input file specification.
Divides a file specification into its three parts, returning them in
fileparse (fullname[, suffixlist])
this order: filename, path, suffix.
The arguments are the same as for basename.($name, $path, $suffix) = fileparse($fullname, @suffixlist)
Called before the other routines to select the appropriate file
fileparse_set_fstype (os-string)
specification syntax for your operating system, to be used in future
File::Basename calls. Currently valid values for
os-string (the operating system) are
VMS, MSWin32,
MSDOS, AmigaOS,
os2, RISCOS, and
MacOS. Uses Unix syntax by default.