mailscanner converter - syntax errors

Wytze van der Raay wytze at nlnet.nl
Wed Sep 21 08:29:06 CEST 2005


Hi Mikael,

> I've tried the MailScanner converter Wytze van der Raay submitted on the
>  lists some time ago :
> 
> http://www.logreport.org/contact/lists/questions/msg00437.php
> 
> I run Debian sarge and Lire 2.2.0.1 (perl 5.8.4) and I get this problem :
> -----------------------------------------------------------------------
> ~/.lire/converters$ lr_log2report  --help dlf-converters
> lr_log2report: WARNING Subroutine new redefined at (eval 156) line 29.
> lr_log2report: WARNING Bareword found where operator expected at (eval
> 156) line 148, near ")_"
> lr_log2report: WARNING  (Missing operator before _?)
> lr_log2report: WARNING Bareword found where operator expected at (eval
> 156) line 168, near ")_"
> lr_log2report: WARNING  (Missing operator before _?)
> lr_log2report: WARNING Bareword found where operator expected at (eval
> 156) line 178, near "$(a"
> lr_log2report: WARNING  (Missing operator before a?)
> lr_log2report: WARNING Bareword found where operator expected at (eval
> 156) line 179, near "$(a"
> lr_log2report: WARNING  (Missing operator before a?)
> lr_log2report: WARNING error while running initializer in
> '/var/lib/lire/.lire/converters/MailScannerConverter.pm': syntax error
> at (eval 156) line 148, near ")_"
> syntax error at (eval 156) line 168, near ")_"
> syntax error at (eval 156) line 178, near "$(a"
> syntax error at (eval 156) line 181, near "} elsif"
> -----------------------------------------------------------------------
> 
> Here's an extract from ~/.lire/converters/MailScannerConverter.pm :
> 
> -----------------------------------------------------------------------
> 147 sub init_dlf_converter {
>     148     my ( $self, $process ) = (a)_;
>     149
>     150     return;
>     151 }
>     152
>     153 =pod
>     154
>     155 =head2 process_log_file( $process, $fd )
>     156
>     157 This method is called so that the converter can converter the data
>     158 contained in the $fd file handle to DLF. This method is only
> used when
>     159 the handle_log_lines() method returned false.
>     160
>     161 $process contains a reference to the Lire::DlfConverterProcess
> object
>     162 which controls the conversion process and defines the API to
> write DLF
>     163 and report errors.
>     164
>     165 =cut
>     166
>     167 sub process_log_file {
>     168     my ( $self, $process, $fh ) = (a)_;
>     169
>     170     my %data = ();
>     171     my $id = 1;
>     172     my $line;
>     173
>     174     while ( defined( $line = <$fh> ) ) {
>     175         chomp $line;
>     176
>     177         my $rec = eval { $self->{syslog_parser}->parse( $line ) };
>     178         if ( $(a) ) {
>     179             $process->error ($(a), $line );
>     180             next;
>     181         } elsif ($rec->{process} ne 'MailScanner' ) {
>     182 ##          $process->ignore_log_line( $line, "not a MailScanner
> record""
>          );
>     183             next;
> 
> -----------------------------------------------------------------------
> 
> Would somebody have an idea about what's wrong ?
> Or is this converter available somewhere else ?

Interesting ... it looks like the mailing list archival software or
display logic has corrupted the script: everywhere where there was
an "@" (at sign) in the original script, it has been replaced by "(a)".
Perl doesn't like that :-)

You can fix your copy of the script by making the reverse substitution:
	s/(a)/@/g
For additional help, I've attached a fresh copy of the script to this
e-mail (but I don't know what its fate will be after mailing list
handling ...).

Regards,
Wytze van der Raay
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MailScannerConverter.pm
Type: application/x-perl
Size: 7685 bytes
Desc: not available
Url : http://lists.logreport.org/pipermail/questions/attachments/20050921/9a060985/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : http://lists.logreport.org/pipermail/questions/attachments/20050921/9a060985/attachment-0001.bin 


More information about the Questions mailing list