canoock has asked for the wisdom of the Perl Monks concerning the following question:

I am using Mail::Audit to process email. In order to process the message body, I need to create a text string out of the array reference handed to me by
my $body = $item->body;
and I do
$tbody = join('',@$body);
The strange thing occurs with the following: Raw input containing
<a style=3D"color: blue" href=3D"http://online.wsj.com/article/SB11966 +351958= 6211071.html?mod=3Dgooglenews_wsj">
is actually changed to
<a style=3D"color: blue" href=3D"http://online.wsj.com/article/SB11966 +35195= 86211071.html?mod=3Dgooglenews_wsj">
What is not visible above is that in both cases the equal sign is followed by NL (x0A). It seems to shift the =NL combination one position to the left in the resulting text string. It happens only in the cases where the line contains "href".

Replies are listed 'Best First'.
Re: Strange join behavior
by moritz (Cardinal) on Dec 04, 2007 at 11:50 UTC
    From your description I don't understand what the difference is, and why you seem to think that it's a strange join behaviour (sounds more like a bug in Mail::Audit, if there is any).

    Could you please provided a minimal, working sample script that demonstrates this?

      I am sorry for not identifying the difference more clearly. In the raw input to join there is ... SB11966 +351958= 6211071 ..... The result is ... SB11966 +35195= 86211071 The 8 has shifted from before "=" to after "-". In both cases, "-" is followed by newline. I do not know if it is a bug in Mail::Audit - that is why I am asking the question. The full code segment is:
      use Mail::Audit; my $item = Mail::Audit->new(); my $body = $item->body; $tbody = join('',@$body);
        Well, I went back to the code and printed the source array / and you are right, it appears that the error is already contained there and not in join as I suggested (wrongly) in the heading of my question.