#!/usr/bin/perl

use warnings;
use strict;
use Net::FTP;

my $host="yourIP";
my $usr="yourUsr";
my $pass="yourPass";
my $path="/yourPub";

my $newerr=0;
my $ftp = Net::FTP->new($host,Debug =>0) or die "Cannot connect to $host: $@";

$ftp->login($usr,$pass) or die "Cannot login ", $ftp->message;

$ftp->cwd($path) or die "Cannot change working directory ", $ftp->message;

$ftp->get("test.file") or die "get failed ", $ftp->message;

$ftp->quit;

arrow
arrow
    文章標籤
    Perl Net::FTP
    全站熱搜
    創作者介紹
    創作者 mark528 的頭像
    mark528

    狐的窩

    mark528 發表在 痞客邦 留言(0) 人氣()