Andrey Demenev wrote:
This is code from Mail::DeliveryStatus::BounceParser

@error_lines = (grep { /\S/ }
                grep { ! /error detail/i }
                grep { /message.*not delivered to the following/i ..
                       /error detail/i } split /\n/, $error_part);

Could someone please explain what thi code does? I am absolutely
new to perl, and these several greps confuse me :(

It extracts certain lines from an email bounce message. This code gives the same result:


    my @tmp = grep {
        /message.*not delivered to the following/i .. /error detail/i
    } split /\n/, $error_part;
    @error_lines = grep { /\S/ and !/error detail/i } @tmp;

Does it possibly help you understand?

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to