in reply to use of uninitialised value
Perl optimizes things like "$upload_dir/$filename" to $upload_dir . '/' . $filename, which is why the warning is complaining about the concatenation operator. One of those variables is not initialized. Try printing them to see which one it is. You've probably got a typo somewhere. If one of them is supposed to be empty in some circumstances, make sure it's set to the empty string ("") instead of remaining uninitialized.