in reply to
parse file name
my ($volume, $directories, $file) = File::Spec->splitpath( $path );
my ($extension) = $file =~ /\.([^\.]+)$/;
So if you want to DWIM, you'd have to keep a list of known file extensions that contain a dot, and special case them.
Or you could consider it to be a recursive definition, so that .gz is the extension of the perl-5.10.1.tar, and .tar is the extension of perl-5.10.1.
6 of one, 1/2 dozen of another.
Please consider supporting my wife as she walks in the 2009 Alzheimer's Walk.
A Programming Language, 1962
Programming the 1900 series in COBOL, 1974
Algorithms + Data Structures = Programs, 1976
The C Programming Language, 1978
System V - Interface definition, 1986
Z80 Assembly Language Programming, 1979
TheSOURCE User's Manual, 1979
The C Primer, 1983
Interactive Fortran 77, A Hands on Approach, 1984
Perl.1 man page, 1991
Results (364 votes),