Yes it's possible. However, before you go any further, what is between your local hard drive and the server on which MERGE.cgi resides. There are security issues here:
1. Your password will be stored in plain text on the server.
2. Your password will be transmitted via plain text for all to see.
Consider using scp or sftp that comes with the ssh package. Or consider having the server email you the file. Perhaps using mpack.
I've always found the easiest way to do this is to e-mail.
Open sendmail as a file and put all the info you need into it. Once you close the e-mail "file" sendmail will ship it off. Depending on your server and volume of e-mail, you should get it nearly instantly.
I have a perl script which does exactly this any time anyone views a home listing on my realty site. It e-mails me the page they looked at, their e-mail address, etc. and I never even have to connect to my server.
print SM <<OUT;
Sweet! What's the address of your server? I'd love to check out your /etc/passwd file...
Seriously, though, piping to sendmail is a big, *big* no-no, especially if it's being done through the web with user-entered data. Look at Mail::Send and a more secure way to do the same thing.
Other than that, I'd definitely suggest e-mailing the file as a great alternative to having to ftp in manually to retrieve the file.
The message text that gets sent out gets run through several checkers first. In my case, if it's not plain old text, it doesn't get sent, just saved to a file, and I get e-mailed about the file's existence.
However, I'd really like to hear about why it's a *big* big No-No.
I thought of doing this - have the file download to me once it's been created by MERGE.cgi, using the Location: $file code.
The problem? It says I don't have access to it. How do I change permissions on the fly?