you probably want to use open(); open(COMMAND, "sqlrun mysqlfile.sql |") or die "cannot execute: $!"; while(<COMMAND>){ #ftp stuff }
> -----Original Message----- > From: Balint, Jess [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 15, 2002 3:05 PM > To: '[EMAIL PROTECTED]' > Subject: Sending Command Output over Net::FTP > > > Hello all, now that this works . . . > I am trying to send the output from a database query over and > FTP connection > into a remote file. When I run it like: > > sqlrun mysqlfile.sql | myperlscript.pl > > It seems to work alright. What I would like to do is have the > perl scripts > kick off the query through a system( ) call and then feed the > output into > the FTP connection. This is the one that works: > > sql -d ltd01 -f q1.sql | > perl -e ' > use lib qw( /qmds/mydir/perl/lib/site_perl/5.005/ ); > use Net::FTP; > while( <> ) { > $ftp=Net::FTP->new("10.206.15.30"); > $ftp->login("mydomain\\myname","mypass"); > $ftp->cwd("/myhome/mydirectory"); > $ftp->put(*STDIN,"myfile.txt") > or die("error!\n"); > $ftp->quit; > } > ' > > What could I use as the filehandle for the output from the > system command? > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]