tags:

views:

131

answers:

2
+5  A: 

So line 36 seems to be

print MYFILE wrap("", "", <<"");

which means perl will wrap the following text until there is terminator "" (I never use confusing item like this, I always use END or UNTIL_END for simplicity.)

That terminator is then found on line 45 (the empty line), meaning next thing it processes is line 46:

else {

which doesn't make sense, since the previous if hasn't closed yet (the line 44 which has } is before the terminator "" so its treated as text for wrapping. Perl notices this and kindly suggest you this might be the culprit:

(Might be a runaway multi-line << string starting on line 36)

You need to swap lines 44 and 45 to first have terminator "" (empty line), then close the if with }. The second wrap in your example does this correctly.

Tuminoid
And the questioner needs to seriously question why it is a good idea to use an invisible terminator, especially since those have caused this question to be asked.
Jonathan Leffler
+2  A: 

Answer to your modified question:

Instead of extirpating the message body, you extirpate the whole message instead. And then you don't use it anywhere.

my $nohtml = extirpate_html( $msg );
$body =~ s/^>.*$//msg;
$Text::Wrap::columns=80;
print MYFILE wrap("", "", <<"");
\n
From: $from
To: $to
Date: $date
Subject: $subject
\n
$body

Perhaps you need to change it to:

my $nohtml = extirpate_html( $body );
$nohtml =~ s/^>.*$//msg;

and then apply the $nohtml as the message body for wrap.

Tuminoid
Thank you for your response. I made the changes as you suggested, but there are still ` <BR>` throughout the file
Joshxtothe4
It just look like the extirpate fails somehow, cannot tell. If nothing else works and the body is otherwise ok to you, add $body =~ s/ <BR>//msg; to remove them.
Tuminoid