Tie::FTP - A module to open files on FTP servers as filehandles
print while (<FH>);
print FH foo;
my $fh = (tied *FH)->tmpfh;
print $fh foo;
This module downloads a file on an FTP server into a temporary file, and allows editing on that. Upon destroy the object rewrites itself to the server if there were any write operations.
Since all the operations are actually delegated you're better off tying a gensym, and then using my $fh = (tied $ftpfh)->tmpfh;. Just remember to call (tied $ftpfh)->taint; if you want to commit changes at DESTROY time.
my $fh = (tied $ftpfh)->tmpfh;
This method accepts either a URI string or object, or a logged in Net::FTP object and a path string.
In the former all login credentials are sucked out of the URI, and a Net::FTP object is created. See CAVEATS.
In the latter form the Net::FTP object is assumed to be connected, and the path string is a relative one.
The file will be written regardless of wether or not there are write permissions.
You may need to do (tied $ftpfh)->ftp->noop; every once in a while, to stir things up.
Net::FTP and URI are not used from within the module as you may prefer to pass other types of objects, with a compatible interface.
Yuval Kogman <email@example.com>
This program is free software licensed under the...
The MIT License
The full text of the license can be found in the LICENSE file included with this module.
To install Tie::FTP, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.