diff options
author | Graham Barr <gbarr@pobox.com> | 2003-05-20 11:18:28 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 2003-05-20 11:18:28 +0000 |
commit | 0bb59690f5402f9054bbfbf911fe9968b656e440 (patch) | |
tree | 4fe419bdfbf9208de7c093a6a9b3266a21a3c34f | |
parent | f9d06a2b46eb12fdaddcde9831fd4d40d746ea23 (diff) | |
download | perl-libnet-0bb59690f5402f9054bbfbf911fe9968b656e440.tar.gz |
Net::POP3
- Add small example to SYNOPSIS
-rw-r--r-- | Net/POP3.pm | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Net/POP3.pm b/Net/POP3.pm index 3263f47..7cd44ef 100644 --- a/Net/POP3.pm +++ b/Net/POP3.pm @@ -13,7 +13,7 @@ use Net::Cmd; use Carp; use Net::Config; -$VERSION = "2.24"; # $Id: //depot/libnet/Net/POP3.pm#23 $ +$VERSION = "2.24"; # $Id: //depot/libnet/Net/POP3.pm#24 $ @ISA = qw(Net::Cmd IO::Socket::INET); @@ -373,6 +373,17 @@ Net::POP3 - Post Office Protocol 3 Client class (RFC1939) $pop = Net::POP3->new('pop3host'); $pop = Net::POP3->new('pop3host', Timeout => 60); + if ($pop->login($username, $password) > 0) { + my $msgnums = $pop->list; # hashref of msgnum => size + foreach my $msgnum (keys %$msgnums) { + my $msg = $pop->get($msgnum); + print @$msg; + $pop->delete($msgnum); + } + } + + $pop->quit; + =head1 DESCRIPTION This module implements a client interface to the POP3 protocol, enabling @@ -383,10 +394,6 @@ A new Net::POP3 object must be created with the I<new> method. Once this has been done, all POP3 commands are accessed via method calls on the object. -=head1 EXAMPLES - - Need some small examples in here :-) - =head1 CONSTRUCTOR =over 4 @@ -540,6 +547,6 @@ it under the same terms as Perl itself. =for html <hr> -I<$Id: //depot/libnet/Net/POP3.pm#23 $> +I<$Id: //depot/libnet/Net/POP3.pm#24 $> =cut |