my $pubupload = q"C:\Documents and Settings\Administrator\Desktop\china.txt"; $pubupload =~ /(?:.*)\\(.*?\..*)$/; print $1;