madtoperl:
A couple of things: First, in the code you've shown, you've forgotten to set $upload_dir, so your open may be failing because of that. Secondly, your regular expression is missing a character. I think you meant this:
s/([^\/\\]+)$//;
But after seeing what you're doing, I'd simplify and rearrange the filename parsing bit to look like this:
my ($drive, $path, $file);
die "Invalid file name!"
unless $file_query1 =~ /(\w:)?(.+)[\\\/](.*)/;
print "Drive=", $1, ", Path=", $2, ", File=", $3, "\n";
In any case, I'd second McDarren's suggestion. I've used Net::FTP and it works nicely for jobs like this.
--roboticus |