http://www.perlmonks.org?node_id=22088

mccormi has asked for the wisdom of the Perl Monks concerning the following question:

I'm looking to be able to ftp from a cgi using Net::FTP without actually writing a local file. Something like put($scalar, "remotelogfile"). I know you can do something similar using *STDIN, put have yet to get *STDOUT to work. Is there a way to write a CGI generated remote file without writing a local file?

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: How to FTP from STDOUT?
by I0 (Priest) on Dec 24, 2000 at 07:31 UTC
    use Net::FTP; $ftp = Net::FTP->new($host) or die $!; $ftp->login($user,$password) or die $!; $sock = $ftp->_data_cmd('stor', "remotelogfile") or die $!; while( <DATA> ){ $sock->write($_,length) or die $!; } $sock->close() or die $!;
Re: How to FTP from STDOUT?
by vaevictus (Pilgrim) on Aug 23, 2000 at 23:26 UTC
    I've worked on this, but was unable to solve it. Check out my question for the relevant info