in reply to help,my upload script is bugged part 2

Note: This has nothing to do with your problem, just something to look into.
Consider using 'tr' instead of 's', for character conversions:
$xxx =~ s/ /_/g; $xxx =~ tr/ /_/;