in reply to using split on a string

If all you want is the filename extension, try a regular expression pattern with capturing group:
if ($pubupload =~ m![^.]\.([^./\\]+)$!) { $extension = $1; }
This pattern will match at least one non-dot character, a dot, then capture one or more non . / and \ characters until the end of string.
$pubupload = 'C:\Documents and Settings\Administrator\Desktop\china.tx +t'; DB<1> if ($pubupload =~ m![^.]\.([^./\\]+)$!) { $extension = $1; } DB<2> print "[$extension]" [txt]

Update:

Modified pattern so that it won't be fooled by dot files (filenames with leading dot) like .notanextension and will require at least one non-dot character in the filename, for example: a.txt.