in reply to Re: Extracting just the extension from a filename.
in thread Extracting just the extension from a filename.
You could also one-line it by catching the matches with alist assignment to avoid reading from $1:
my ($extension) = $filename =~ /\.([^\.]+)$/;
|
|---|