For portably getting the basename of a file given a full path, I’d recommend the File::Basename module, which is part of the core.
To do heuristics on file extensions I’d go for a regular expression like
(my $without_extension = $basename) =~ s/\.[^.]+$//;