in reply to Re: Finding a extention
in thread Finding a extention

You can also use a regex so that you don't have to worry about listing all the possible extensions.

foreach("fp.html", "fp.cgi", "fp.pl", "fp.foo", "fp.blah") { my ($base, $path, $type) = fileparse("/home/users/rich36/$_", qr{\ +..+}); print qq($base, $path, $type\n); } __RESULT__ fp, /home/users/rich36/, .html fp, /home/users/rich36/, .cgi fp, /home/users/rich36/, .pl fp, /home/users/rich36/, .foo fp, /home/users/rich36/, .blah
«Rich36»