Remove file extension and path from a string in Perl

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/\.[^.]+$//;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)