http://qs1969.pair.com?node_id=1172253


in reply to Re: Parse out the extension of a filename - return base of filename.
in thread Parse out the extension of a filename - return base of filename.

The key to this working is the regular expression passed to the fileparse method

Too bad File::Basename doesn't set a reasonable default for the fileparse() RE based on the OS like it does for the path separator. If you understand REs well enough to supply a correct one to fileparse(), you most certainly don't need File::Basename to get the file extension!

  • Comment on Re^2: Parse out the extension of a filename - return base of filename.