Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: Re: Removing Signature from Email

by Wodin (Acolyte)
on Apr 08, 2001 at 14:10 UTC ( [id://70814]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Removing Signature from Email
in thread Removing Signature from Email

Looking at the docs for Mail::POP3Client, I think you want to get the body as an array of lines and then iterate over that array, keeping only those lines which are not the signature and the line immediately following it. Right now, you're saying  $body = $pop->Body($i); which would be in a scalar context and force Mail::POP3Client to return the body as one big string.

Hopefully, the following code will clear up your problem. Be warned that this is untested.

my @lines = $pop->Body($i); ## Some code passes, not much, not a little, what am I, a watch? ## iterate over @lines, checking if we want to keep it. print OUTPUT "<body>\n"; foreach $line (@lines) { if ($line =~ /^--$/) { # Everything else is signature, # so we break the foreach loop last; } else { print OUTPUT $line; } } print OUTPUT "\n<\body>\n";
Hope this works.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://70814]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-26 04:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found