Connector::Proxy::Net::FTP
Read/Write files to/from a remote host using FTP.
LOCATION is the only mandatory parameter, if neither file nor path is set, the file is constructed from the arguments given to the method call.
The DNS name or IP of the target host.
Port number (Integer), default is 21.
Pattern for Template Toolkit to build the filename. The connector path components are available in the key ARGS. In set mode the unfiltered data is also available in key DATA. For security reasons, only word, space, dash, underscore and dot are allowed in the filename. If you want to include a directory, add the path parameter instead!
Same as file, but allows the directory seperator (slash and backslash) in the resulting filename. Use this for the full path including the filename as the file parameter is not used, when path is set!
A basedir which is always prepended to the path.
Pattern for Template Toolkit to build the content. The data is passed "as is". If data is a scalar, it is wrapped into a hash using DATA as key.
FTP username
FTP password
FTP connection timeout, default is 30 seconds
Set the debug flag for Net::FTP
Use FTP active transfer. The default is to use passive transfer mode.
Use binary or ascii transfer mode. Note that binary is the default!
Write data to a file.
$conn->set('filename', { NAME => 'John Doe', 'ROLE' => 'Administrator' });
See the file parameter how to control the filename.
Fetch data from a file. See the file parameter how to control the filename.
my $data = $conn->set('filename');
Return the file names in the given directory.
my $conn = Connector::Proxy::Net::FTP->new({ LOCATION => 'localhost', file => '[% ARGS.0 %].txt', basedir => '/var/data/', content => ' Hello [% NAME %]', }); $conn->set('test', { NAME => 'John Doe' });
Results in a file /var/data/test.txt with the content Hello John Doe.
To enable the scp transfer, the file is created on the local disk using tempdir/tempfile. The directory is created with permissions only for the current user, so no other user than root and yourself is able to see the content. The tempfile is cleaned up immediatly, the directory is handled by the internal garbage collection.
To install Connector, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Connector
CPAN shell
perl -MCPAN -e shell install Connector
For more information on module installation, please visit the detailed CPAN module installation guide.