in reply to Removing Signature from Email

Here is a piece of code that will remove the signature (and only the signature!) from a message, provided the signature is stored in the __DATA__ part of the script:

#/bin/perl -w use strict; # read the signatures $/="\n\n"; my @sig= <DATA>; chomp @sig; # chomp every element, so we get rid of the extra \ +n undef $/; my $message= <>; # read the message foreach my $sig (@sig) { # \Q \E quotes the meta-characters in $sig # \s* skips trailing spaces or \n # and last just avoids unnecessary extra matches $message=~ s{\Q$sig\E\s*}{}s and last; } print $message; __DATA__ _______________________________________________ Perl-XML mailing list Perl-XML@listserv.ActiveState.com http://listserv.ActiveState.com/mailman/listinfo/perl-xml -- PHP Windows Mailing List (http://www.php.net/) ----------------------------