File: example.pl

package info (click to toggle)
libnet-lite-ftp-perl 0.54-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 80 kB
  • ctags: 45
  • sloc: perl: 387; makefile: 45
file content (18 lines) | stat: -rwxr-xr-x 488 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl -w
#
use lib "./lib";
use Net::Lite::FTP;

my $tlsftp=Net::Lite::FTP->new();
$tlsftp->open("ftp.tls.pl","21");
$tlsftp->user("user");
$tlsftp->pass("password");
$tlsftp->list();
$tlsftp->cwd("pub");
my $files=$tlsftp->list("*.exe");
foreach $f (@$files) {
 print "File: $f\n";
};
$tlsftp->get("File.txt");# Will overwrite "File.txt" at local directory
my $slurped=$tlsftp->slurp("Some.file.txt");# Slurp remote file into scalar.
print length($slurped)." bytes slurped\n";