[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Premail/PERL 5.004 fix


I've needed to upgrade PERL recently to 5.004 because
some new software wouldn't work without it.  I didn't
want to do it because I heard it would break premail.

I decided to DL the old perl-5.003 RPM from sunsite
just in case 5.004 really screwed premail up.  The
actual truth of the matter is that 5.004 just warns
you that premail re-declares several variable.  Apparently
this has no effect on the program, but those warnings
are pretty annoying.  Here is now you fix it:

Define a WARN trap that checks a variable (DOWARN)
to see whether it should warn or not.  Since the
re-declarations occurr in three different places
you just have to set DOWARN to 0 before the line
and then DOWARN to 1 after the line.  Crude, but
effective.  Most of this code can be found by
doing a man page on 'perlfunc', but I thought I'd
save someone the time.

Here is the diff for premail version .449.

> BEGIN { $SIG{'__WARN__'} = sub { warn $_[0] if $DOWARN } }
> $DOWARN = 0;
>     $DOWARN = 0;
>     $DOWARN = 1;
>     $DOWARN = 0;
>     $DOWARN = 1;
>     $DOWARN = 0;
>     $DOWARN  = 1;

Your milelage may vary...

Jim Burnes
[email protected]