[Mimedefang] verbose complaints from Anomy::HTML

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Tue Jul 23 08:53:01 EDT 2002


On Tue, 23 Jul 2002, Tony Nugent wrote:

> On Mon Jul 08 2002 at 16:19, Rich West wrote:
>
> > I have finally gotten around to tinkering with the Anomy::HTML
> > implementation within Mimedefang in order to make it more usable, and I
> > had a question for David...
>
> I haven't seen any follow-up on Rich's questions, I'm wondering if
> there is any solution yet (or on the way).

Well, there had been one reply implying that one of $4.$5.$6 has not
matched in the previous regex, hence, because the script is started
with perl's -w option (prints warnings about dubious constructs), the
warning is issued.

The answer was you can "ignore"  them.

So if you can, you can also shut up perl by testing $4, $5 and $6, e.g.
replace the concatenation in the function call

$self->cleanTag_2($tag, $val, $1, $2, $3, $4.$5.$6);

by:

($4 || '') . ($5 || '') . ($6 || '')

-or:
($4? $4: '') . ($5? $5: '') . ($6? $6: '')

-or disable the warning around this particular code, e.g.:

===
my $_ska_originalWarningLevel = $^W;
$^W = 0;

$attr =~
s/(\s+)([a-z0-9_:-]+)(?:(\s*=(?:3D)?)(?:\"([^\"]+)\"|\'([^\']+)\'|([^\'\"\s=]\S*)))?(?=(?:\s|$))/
   $self->cleanTag_2($tag, $val, $1, $2, $3, $4.$5.$6);
 /gise;


$^W = $_ska_originalWarningLevel;
===

-or disable warnings in HTMLCleaner.pm alltogether by adding:

$^W = 0;

near the top.

Bye,

-- 

Steffen Kaiser






More information about the MIMEDefang mailing list