use File::Basename qw( basename ); my $fn = basename($path);