Etilem_net.pm


Code Index:


NAME

package Net::FTP::Etilem_net


DESCRIPTION

Fast get/put/del of filenames (not dirs) on 'ftp.etilem.net' FTPSSL server.

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


COPYRIGHT

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_net;

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

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

our $ftp_server = "ftp.etilem.net";
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;
}
1;