Subject: | MOBY::CommonSubs rises syntax errors on Perl 5.18 |
Meanwhile we were upgrading from Ubuntu 12.04 to 14.04 on two of our hosts (each one having a MOBY server instance), we have realized that the servers stopped working because MOBY::CommonSubs rises syntax errors. As the code didn't change, we dug in the issue and we realized that Perl 5.18 is stricter about foreach syntax than Perl 5.14 (which came with Ubuntu 12.04).
The patch to fix this issue is included as attachment.
Subject: | MOBY-CommonSubs-perl-5.18.x.patch |
diff -Nru a/MOBY-1.15/lib/MOBY/CommonSubs.pm b/MOBY-1.15/lib/MOBY/CommonSubs.pm
--- a/MOBY-1.15/lib/MOBY/CommonSubs.pm 2009-09-01 20:13:20.000000000 +0000
+++ b/MOBY-1.15/lib/MOBY/CommonSubs.pm 2015-03-20 15:45:28.000000000 +0000
@@ -407,7 +407,7 @@
my ( $XML ) = @_;
my $moby = _string_to_DOM($XML);
my @queries;
- foreach my $querytag qw(mobyData )
+ foreach my $querytag (qw(mobyData ))
{
my $x = $moby->getElementsByLocalName( $querytag ); # get the mobyData block
for ( 1 .. $x->size() ) { # there may be more than one mobyData per message
@@ -1637,7 +1637,7 @@
my ( $XML ) = @_;
my $moby = _string_to_DOM($XML);
my @queries;
- foreach my $querytag qw( queryInput moby:queryInput mobyData moby:mobyData )
+ foreach my $querytag (qw( queryInput moby:queryInput mobyData moby:mobyData ))
{
my $x = $moby->getElementsByTagName( $querytag ); # get the mobyData block
for ( 1 .. $x->size() ) { # there may be more than one mobyData per message