From 1c06f77a10dc580e580a10e776a2b986e5eab5e2 Mon Sep 17 00:00:00 2001 From: Graham Barr Date: Tue, 20 May 2003 11:24:08 +0000 Subject: Net::FTP - Add some error checking to the examples in the SYNOPSIS --- Net/FTP.pm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Net/FTP.pm b/Net/FTP.pm index 608882f..07e1a6f 100644 --- a/Net/FTP.pm +++ b/Net/FTP.pm @@ -22,7 +22,7 @@ use Net::Config; use Fcntl qw(O_WRONLY O_RDONLY O_APPEND O_CREAT O_TRUNC); # use AutoLoader qw(AUTOLOAD); -$VERSION = "2.68"; # $Id: //depot/libnet/Net/FTP.pm#71 $ +$VERSION = "2.68"; # $Id: //depot/libnet/Net/FTP.pm#72 $ @ISA = qw(Exporter Net::Cmd IO::Socket::INET); # Someday I will "use constant", when I am not bothered to much about @@ -1199,10 +1199,18 @@ Net::FTP - FTP Client class use Net::FTP; - $ftp = Net::FTP->new("some.host.name", Debug => 0); - $ftp->login("anonymous",'-anonymous@'); - $ftp->cwd("/pub"); - $ftp->get("that.file"); + $ftp = Net::FTP->new("some.host.name", Debug => 0) + or die "Cannot connect to some.host.name: $@"; + + $ftp->login("anonymous",'-anonymous@') + or die "Cannot login ", $ftp->message; + + $ftp->cwd("/pub") + or die "Cannot change working directory ", $ftp->message; + + $ftp->get("that.file") + or die "get failed ", $ftp->message; + $ftp->quit; =head1 DESCRIPTION @@ -1721,6 +1729,6 @@ under the same terms as Perl itself. =for html
-I<$Id: //depot/libnet/Net/FTP.pm#71 $> +I<$Id: //depot/libnet/Net/FTP.pm#72 $> =cut -- cgit v1.2.3-24-ge0c7