[Mimedefang] error: use of uninitialized variable in Bayes.pm

Lee Dilkie lee at dilkie.com
Mon Feb 2 14:25:45 EST 2004


Gents,

I got this error showing up in my logs. It's for the bayes.pm scipt
(program?library?)

b  2 10:54:27 spock mimedefang-multiplexor: Slave 1 stderr: Use of
uninitialized value at
/usr/local/lib/perl5/site_perl/5.005/Mail/SpamAssassin/Bayes.pm line 519.
Feb  2 10:54:27 spock mimedefang-multiplexor: Slave 1 stderr: Use of
uninitialized value at
/usr/local/lib/perl5/site_perl/5.005/Mail/SpamAssassin/Bayes.pm line 521.
Feb  2 10:54:27 spock mimedefang-multiplexor: Slave 1 stderr: Use of
uninitialized value at
/usr/local/lib/perl5/site_perl/5.005/Mail/SpamAssassin/Bayes.pm line 522.
Feb  2 10:54:29 spock mimedefang-multiplexor: Slave 1 stderr: Use of
uninitialized value at
/usr/local/lib/perl5/site_perl/5.005/Mail/SpamAssassin/Bayes.pm line 519.
Feb  2 10:54:29 spock mimedefang-multiplexor: Slave 1 stderr: Use of
uninitialized value at
/usr/local/lib/perl5/site_perl/5.005/Mail/SpamAssassin/Bayes.pm line 521.
Feb  2 10:54:29 spock mimedefang-multiplexor: Slave 1 stderr: Use of
uninitialized value at
/usr/local/lib/perl5/site_perl/5.005/Mail/SpamAssassin/Bayes.pm line 522.

My perl isn't very good yet. The lines referenced "look" like they are
initialized to me (although the expression isn't one i can parse).

sub pre_chew_content_type {
  my ($self, $val) = @_;

  # hopefully this will retain good bits without too many hapaxen
  if ($val =~ s/boundary=[\"\'](.*?)[\"\']/ /ig) {
    my $boundary = $1;
519-->    $boundary =~ s/[a-fA-F0-9]/H/gs;
    # break up blocks of separator chars so they become their own tokens
521-->    $boundary =~ s/([-_\.=]+)/ $1 /gs;
522-->    $val .= $boundary;
  }

  # stop-list words for Content-Type header: these wind up totally gray
  $val =~ s/\b(?:text|charset)\b//;

  $val;
}

I'm thinking the $1 variable is not set to anything. I'm not sure what a $1
is, it looks kinda special....

This problem only started showing up today when my bayes auto-learn finally
got enough "stuff" to be able to generate scores.

can anyone help?

thanks,

-lee




More information about the MIMEDefang mailing list