Using perl Syntax Highlighting
- #!/usr/bin/perl
- use strict;
- use warnings;
- use Net::FTP;
- my $ftp_site = 'server';
- my $ftp_dir = 'OUT';
- my $ftp_user = 'username';
- my $ftp_password = 'password';
- my $glob = 'ASN*';
- my @remote_files;
- my $ftp = Net::FTP->new($ftp_site)
- or die "Could not connect to $ftp_site: $!";
- $ftp->login($ftp_user, $ftp_password)
- or die "Could not login to $ftp_site with user $ftp_user: $!";
- $ftp->cwd($ftp_dir)
- or die "Could not change remote working " .
- "directory to $ftp_dir on $ftp_site";
- @remote_files = $ftp->ls($glob);
- foreach my $file (@remote_files) {
- print "Archivo: $file\n";
- }
- $ftp->quit();
Coloreado en 0.005 segundos, usando GeSHi 1.0.8.4