xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/Net/demos/ftp (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#!/usr/local/bin/perl
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gateuse blib;
4*0Sstevel@tonic-gateuse Net::FTP;
5*0Sstevel@tonic-gateuse Getopt::Long;
6*0Sstevel@tonic-gate
7*0Sstevel@tonic-gate$opt_debug = undef;
8*0Sstevel@tonic-gate$opt_firewall = undef;
9*0Sstevel@tonic-gate
10*0Sstevel@tonic-gateGetOptions(qw(debug firewall=s));
11*0Sstevel@tonic-gate
12*0Sstevel@tonic-gate@firewall = defined $opt_firewall ? (Firewall => $opt_firewall) : ();
13*0Sstevel@tonic-gate
14*0Sstevel@tonic-gateforeach $host (@ARGV)
15*0Sstevel@tonic-gate {
16*0Sstevel@tonic-gate  $ftp = Net::FTP->new($host, @firewall, Debug => $opt_debug ? 1 : 0);
17*0Sstevel@tonic-gate  $ftp->login();
18*0Sstevel@tonic-gate  print $ftp->pwd,"\n";
19*0Sstevel@tonic-gate  $ftp->quit;
20*0Sstevel@tonic-gate }
21*0Sstevel@tonic-gate
22