#!perl

use 5.008001;

use strict;
use warnings;

use blib;
use Getopt::Long;
use Net::FTP;

our $opt_debug = undef;
our $opt_firewall = undef;

GetOptions(qw(debug firewall=s));

my @firewall = defined $opt_firewall ? (Firewall => $opt_firewall) : ();

foreach my $host (@ARGV)
 {
  my $ftp = Net::FTP->new($host, @firewall, Debug => $opt_debug ? 1 : 0);
  $ftp->login();
  print $ftp->pwd,"\n";
  $ftp->quit;
 }

