use File::Spec::Win32; my $path = q{ABCDEF\AB1010\datei.txt}; print $path; my $file = (File::Spec::Win32->splitpath($path))[-1];