BlackBoard (http://www.black-board.net/index.php)
- Design, Programmierung & Entwicklung (http://www.black-board.net/board.php?boardid=55)
-- Programmieren (http://www.black-board.net/board.php?boardid=4)
--- Perl FXP mit Perl (http://www.black-board.net/thread.php?threadid=20517)
Zitat: |
#!/bin/perl use Net::FTP; my $host = 'localhost'; my $user = 'thomas'; my $password = 'topsecret'; # Neues Net::FTP-Objekt my $ftp = Net::FTP->new($host, Timeout => 360, Debug => 1 ); unless (defined $ftp) { print "$@\n"; die "Can't create Net::FTP-Object\n"; } $ftp->login($user,$password) || die "Can't login $!"; print "Aktuelles Verzeichnis des FTP-Servers: ", $ftp->pwd() , "\n"; my $file; my $array_ref = $ftp->ls(); foreach $file (@$array_ref) { # Transfermodus in Abhängigkeit von der Dateiendung setzen if ($file =~ /(\.gif|\.jpg|\.tar|\.tar\.gz|\.tgz|\.zip)$/) { $ftp->type(I); } else { $ftp->type(A); } ## if else $ftp->get($file) || next; } ## foreach $ftp->quit(); __END__ |
Forensoftware: Burning Board 2.3.6, entwickelt von WoltLab GmbH