in reply to Re: Extracting just the extension from a filename.
in thread Extracting just the extension from a filename.

Good solution. My only additions would be to use \^\.\ instead of \w to catch \W as well but not ".".

You could also one-line it by catching the matches with alist assignment to avoid reading from $1:

my ($extension) = $filename =~ /\.([^\.]+)$/;