|
From: <ssc...@us...> - 2003-08-20 06:48:28
|
Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv32299
Modified Files:
Bayes.pm
Log Message:
echo_to_dot_ fix. caller specifies open style for now (>> may not always be desired?)
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.179
retrieving revision 1.180
diff -C2 -d -r1.179 -r1.180
*** Bayes.pm 1 Aug 2003 00:59:56 -0000 1.179
--- Bayes.pm 20 Aug 2003 06:11:07 -0000 1.180
***************
*** 1712,1716 ****
# $mail The stream (created with IO::) to send the message to (the remote mail server)
# $client (optional) The local mail client (created with IO::) that needs the response
! # $file (optional) A file to print the response to
# $before (optional) String to send to client before the dot is sent
#
--- 1712,1716 ----
# $mail The stream (created with IO::) to send the message to (the remote mail server)
# $client (optional) The local mail client (created with IO::) that needs the response
! # $file (optional) A file to print the response to, caller specifies open style
# $before (optional) String to send to client before the dot is sent
#
***************
*** 1724,1728 ****
my ( $self, $mail, $client, $file, $before ) = @_;
! open FILE, ">>$file" if ( defined( $file ) );
while ( <$mail> ) {
--- 1724,1728 ----
my ( $self, $mail, $client, $file, $before ) = @_;
! my $isopen = (open FILE, "$file" if ( defined( $file ) ));
while ( <$mail> ) {
***************
*** 1739,1743 ****
if ( defined( $before ) && ( $before ne '' ) ) {
print $client $before if ( defined( $client ) );
! print FILE $before if ( defined( $file ) );
}
--- 1739,1743 ----
if ( defined( $before ) && ( $before ne '' ) ) {
print $client $before if ( defined( $client ) );
! print FILE $before if ( defined( $isopen ) );
}
***************
*** 1751,1759 ****
print $client $_ if ( defined( $client ) );
! print FILE $_ if ( defined( $file ) );
}
! close FILE if ( defined( $file ) );
}
--- 1751,1759 ----
print $client $_ if ( defined( $client ) );
! print FILE $_ if ( defined( $isopen ) );
}
! close FILE if ( $isopen );
}
|