Hi, Ive been using a script to retrieve messages & process them, & delete messages ok.. it works fine, Im now transfering the code over to a new script.... however it now gets the message correctly, But it refuses to delete the message afterwards. Is there a 'debug' thing for pop3 commands ? a summary of commands i'm using are :-
use Net::POP3; # This debug flag will print debugging code to your browser, depending + on its value # Set this to 1 to send debug code to your browser. Set it to 0 to tu +rn it off. my $DEBUG = 1; if($DEBUG) { $| = 1; open(STDERR, ">&STDOUT"); } # Set this variable to your POP3 server name my $ServerName = "my.server.com"; # Create a new POP3 object my $pop3 = Net::POP3->new($ServerName, Debug => 0) or die "Couldn't lo +g on to server"; # Initiate the mail transaction my $UserName = "username"; my $Password = "password"; my $Num_Messages = $pop3->login($UserName, $Password); # Get the list of messages my $Messages; my $msg_id; $Messages = $pop3->list(); # Parse each message header for "From" and "Subject" fields foreach $msg_id (keys(%$Messages)) { if ($msg_id <$end){ next; } my $MsgContent = $pop3->top($msg_id, 50); PrintList($msg_id,@$MsgContent); my $delete = $pop3->delete($msg_id);
------------- END QUOTE MY WORDS :- ok, Printlist does the main processing of the message - & it works.. & ive verified that $msg_id is still correct - But it wont delete...

Ive even put the delete funcrtion immediatly after the message - eg :-
my $MsgContent = $pop3->top($msg_id, 50); my $delete = $pop3->delete($msg_id); PrintList($msg_id,@$MsgContent);
Even if I delete before it gets processed - It still processes the message, However it doesnt delete.

Can someone advise

Thankyou

In reply to POP3 Delete ? by Gordonisnz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.