[ale] retrieving a file via ftp in perl

Scott McBrien smcbrien at gmail.com
Mon Nov 29 08:03:01 EST 2010


I doubt that it'll work the way you want, the problem is that you have to open up the file for io in order to read it into the array.  If the file isn't resident on your machines filesystem, that doesn't work so well.  FTP isn't really designed to give inline access to a file as it doesn't have a way to open and maintain the state of the file mid-transfer.  I'd suggest getting the file, putting it in /tmp or /var/tmp, then use the standard perl io stuff to work with it.  You can always unlink the file once it's been read into your program if that disk space is a concern.

-Scott

On Nov 26, 2010, at 3:20 PM, Geoffrey Myers <lists at serioustechnology.com> 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.
> 
> 
> -- 
> Until later, Geoffrey
> 
> "I predict future happiness for America if they can prevent
> the government from wasting the labors of the people under
> the pretense of taking care of them."
> - Thomas Jefferson
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo



More information about the Ale mailing list