Perl 访问FTP
发布时间:2020-12-15 23:58:06 所属栏目:大数据 来源:网络整理
导读:#ftp#ljl#!/usr/bin/perluse strict;use Net::FTP;my $user = "anonymous";my $passwd = "chinaunix@";my $host = "ftp.freebsd.org";my $ftp = Net::FTP-new("$host",Debug =0)or die "Can't connect to $host: $@n";$ftp-login("$user","$passwd")or die
#ftp #ljl #!/usr/bin/perl use strict; use Net::FTP; my $user = "anonymous"; my $passwd = "chinaunix@"; my $host = "ftp.freebsd.org"; my $ftp = Net::FTP->new("$host",Debug =>0) or die "Can't connect to $host: $@n"; $ftp->login("$user","$passwd") or die "Can't loginn",$ftp->message; $ftp->cwd("/pub/FreeBSD/doc/") or die "Can't change dirn",$ftp->message; $ftp->get("README") or die "get failedn",$ftp->message; $ftp->quit; exit 0; FTP下载 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |