filename is a perl module containing some simple functions for extracting parts of filenames and converting them to a prettier form. Copyright (c) 2018 Tim Chadburn. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the file "fdl.txt" which is part of this package. filename is a perl module containing some simple functions for extracting parts of filenames and converting them to a prettier form. name2title(NAME) NAME must be a string. This function returns NAME with all hyphens turned into spaces and with the first letter of every word after this has been done capitalized. fname2title(FILENAME) FILENAME must be a string. This function returns the part of FILENAME before the first dot with all hyphens turned into spaces and with the first letter of every word after this has been done capitalized. filetype(FILENAME) This returns the part of FILENAME after the first dot. name(FILENAME) This returns the part of FILENAME before the first dot. subdir(LEVEL, PATH) LEVEL must be a number. PATH must be a filesystem pathname. subdir returns PATH without the first LEVEL directories. Hence subdir (1, "one/two/three") would return "two/three". path2name(LEVEL) This returns a function reference for a function that will take one argument, PATH, and function the same way as subdir using the LEVEL passed to path2name. Thus: $function = path2name(2); &$function("one/two/three"); # returns "three"