Code error in line where there is no code

View thread

EZ

When I use xm_perl with this code from /usr/libexec/nxlog/modules/extension/perl/event1.pl:

use Log::Nxlog;
use strict;
use warnings;
use feature 'say';
use JSON;
use utf8;


sub rec2msg {
    my $msgsrcaddr = Log::Nxlog::get_field($event, 'MessageSourceAddress');
    if ( defined($msgsrcaddr) )
    {
        Log::Nxlog::set_field_string($event, 'MessageSourceCountry', "France");
    }
}

It gives me strange error:

syntax error at /usr/libexec/nxlog/modules/extension/perl/event1.pl line 16, at EOF

However , there is no code at line 16 at all. What does that mean? It happens when I use any perl code.