Net::FTP::blat - more methods for Net::FTP Client class
use Net::FTP; use Net::FTP::blat; # See Net::FTP for how to set up connection # get a remote file to a scalar $ftp->slurp(README => my $readme); # put a scalar to a remote file $ftp->blat( $blog_entry_text, "entry: ".localtime );
Net::FTP::blat contains two additional methods for Net::FTP.
Net::FTP::blat
slurp and blat were written by altering get and put from Net::FTP to use a scalar instead of a local file for the local side of the transfer.
slurp
blat
get
put
Slurp REMOTE_FILE from the server and store locally, into a scalar variable. Returns the value too, if you don't want to pass the destination in. Croaks on all errors. Warns on file-not-found before assigning undef, if warnings are in effect.
REMOTE_FILE
Blat the local scalar into the named file on the remote server. The remote name is required. Returns the scalar, for use in assignment chaining. Croaks on errors.
Net::FTP error messages are not imported into the croak exceptions at this version. They may be in the future.
I would like to see slurp and blat included in the Net::FTP distribution. I was surprised that they (or equivalents) were not included.
David Nicol <davidnico@cpan.org>
Net::FTP
Tie::FTP
Net::FTP::Common
IO::FTP
These methods are derived from the get and put methods in Net::FTP, by Graham Barr.
Copyright 2003,2013 David Nicol
These methods are free software; you can redistribute and/or modify them under the same terms as Perl itself.
Version 0.03 issues a spurious PASS for all tests when the hardcoded FTP server that has been getting small test files blatted to it for the last decade is down.
If you would like to propose modifications (such as integrating a pure-perl FTP server running on localhost into the testing) this module may be cloned from https://github.com/davidnicol/cpan-Net-FTP-blat
To install Net::FTP::blat, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::FTP::blat
CPAN shell
perl -MCPAN -e shell install Net::FTP::blat
For more information on module installation, please visit the detailed CPAN module installation guide.