$fullname = "C:\\apple\\index.htm"; my ($file) = $fullname =~ m!([^/\\]+)$!; print $file;