FTP client program written with Perl

xiaoxiao2021-03-06  70

#! / usr / bin / perl # OK, Let's beginning = "10.20.30.40"; $ user = "password"; $ pass = "password"; $ pass = "password"; $ PASS = "password"; $ PATH = "/ home / mengge / testpath"; # login to Host && Change CWDmy $ ftp = new net :: ftp ($ host); $ ftp-> login ($ user, $ pass) || DIE "ERROR ON LOGGING IN: $! "; $ ftp-> cwd ($ PATH) || DIE" Error On Changing Directory: $! "; # list files in the cwdmy @allfiles = $ ftp-> ls (); foreach my $ file (@allfiles ) {Print "$ file / n";} #After list, quit $ ftp-> quit (); # end of this script.

转载请注明原文地址:https://www.9cbs.com/read-85841.html

New Post(0)