in reply to read FTP file line by line
Your best bet (presuming a recent enough Perl) probably would be to open a filehandle for a scalar as the local file to the get method, then split that on newlines and process from there. The problem with that though is that you're going to have to keep the entire file in RAM locally which might be a problem (for large enough files).
my $sink = ''; open( my $fh, '>', \$sink ) or die "Can't open handle into scalar: $!\ +n"; ## ... $ftp->get( "remote", $fh ); my @lines = split( /\n/, $sink ); for( @lines ) { ## ... }
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|