#!perl

use 5.008001;

use strict;
use warnings;

use blib;
use Getopt::Long;
use Net::POP3;

our $opt_debug = 0;
our $opt_user = undef;

GetOptions(qw(debug user=s));

my $pop = Net::POP3->new('backup3', Debug => $opt_debug ? 6 : 0);

my $user = $opt_user || $ENV{USER} || $ENV{LOGNAME};

my $count = $pop->login($user);

if($count)
 {
  my $m = $pop->get(1);
  print @$m if $m;
 }

$pop->quit;
