Skip to content

Instantly share code, notes, and snippets.

@tartansandal
Created March 16, 2015 21:53
Show Gist options
  • Save tartansandal/1f2582c4fca42719925e to your computer and use it in GitHub Desktop.
Save tartansandal/1f2582c4fca42719925e to your computer and use it in GitHub Desktop.
Trigger error hidding with Net-FTP- 2.77
#!/usr/bin/perl
use strict;
use warnings;
use Net::FTP;
use Devel::SimpleTrace;
my $server = 'ftp.arin.net';
my $passive = 1; # <<< toggle this ;-)
my $file_name = 'T*'; # <<< but make sure that there are no T* files in the dir.
my $dir = '/pub/stats';
my $ftp = Net::FTP->new($server,Debug=>3,Passive=>$passive) or die "Cannot connect to $server: $@";
$ftp->login("anonymous",'-anonymous@') or die "Cannot login ", $ftp->message;
$ftp->cwd($dir) or die "Cannot change working directory ", $ftp->message;
my $res = $ftp->ls($file_name) or die $ftp->message;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment