Code Index:


package Net::FTP::Etilem_free


Fast get/put/del of filenames (not dirs) on '' FTP server.

Need FTP password and Net::FTP::CommonClear package, use this file as template for your server :)


Copyright 2010 Etienne LEMEE <coding AT etilem DOT net>

This piece of code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

#!/usr/bin/perl -w

package Net::FTP::Etilem_free;

use strict;
use vars qw!@ISA @EXPORT!;
use Net::FTP::CommonClear;
use Term::ReadKey;

@ISA = qw!Net::FTP::CommonClear!;
@EXPORT = qw!$ftp_server $ftp_user!;

our $ftp_server = "";
our $ftp_user = "etilem";

sub new {
    my $class = shift;
    my $self = {};
    $self->{FTP_SERVER} = $ftp_server;
    $self->{FTP_USER} = $ftp_user;
    print "Password for user $ftp_user at $ftp_server ? ";
    ReadMode 2; #noecho
    chomp($self->{FTP_PASS} = <STDIN>);
    ReadMode 0; #default
    print "\n";
    $self->{QUIET} = shift || 0;
    bless($self, $class);
    return $self;