[ale] retrieving a file via ftp in perl

Mark Heiges mheiges at gmail.com
Mon Nov 29 09:45:03 EST 2010


On Nov 26, 2010, at 3:20 PM, Geoffrey Myers wrote:

> I would like to retrieve a file via perl using ftp, but I want to read
> the file into an array in perl, rather then drop it on the machine  
> as a
> file.  Anyone know if this is possible?  I don't see such  
> functionality
> with Net::FTP.
>


you can have get() send the file to an IO::Scalar handle.

my $SH = new IO::Scalar;
$ftp->get($file, $SH);
seek $SH, 0, 0;
while (<$SH>) {
     print $_;
}



More information about the Ale mailing list