Bio-GMOD

 view release on metacpan or  search on metacpan

GMOD/Util/Mirror.pm  view on Meta::CPAN

  croak "Usage: Mirror->new(\$host:/path)" unless $host && $path;
  if ($host =~ /(.+):(.+)/) {
    ($host,$path) = ($1,$2);
  }
  $path ||= '/';
  $user ||= 'anonymous';
  $pass ||= "$user\@localhost.localdomain";
  
  my %transfer_opts;
  $transfer_opts{Passive} = 1 if $passive;
  $transfer_opts{Timeout} = 600;
  my $ftp = Net::FTP->new($host,%transfer_opts) || croak "Can't connect: $@\n";
  $ftp->login($user,$pass) || croak "Can't login: ",$ftp->message;
  $ftp->binary;
  $ftp->hash(1) if $hash;
  my %opts = (host  => $host,
	      path   => $path,
	      localpath => $localpath,
	      verbose   => $verbose,
	      user      => $user,
	      pass      => $pass,



( run in 0.250 second using v1.01-cache-2.11-cpan-4d50c553e7e )