Subject: | Possible precedence issue with control flow operator at line 160 of Device/LaCrosse/WS23xx/MemoryMap.pm |
Date: | Mon, 04 Jan 2016 20:45:26 +0000 |
To: | <bug-Device-LaCrosse-WS23xx [...] rt.cpan.org> |
From: | "mike" <mikeh [...] csits.net> |
When running a script that uses the Device::LaCrosse module, I've noticed the
error "Possible precedence issue with control flow operator at line 160 in
Device/LaCrosse/WS23xx/MemoryMap.pm" is printed out. This does not appear to
impact the running of the script.
Some rudimentary Googling suggests that this started appearing in various
scripts following the release of PERL 5.20, indeed, that is the version that I
am running.
I have taken a look around line 160 and I see:
# Get the field info.
# FIXME: If there's no such field, return undef instead of croaking?
return $self->{fields}->{lc $canonical_field}
or croak "No such value, '$field'";
I declined to remove the croak, as per the FIXME but I have reworked the code
as follows:
if (defined $self->{fields}->{lc $canonical_field}) {
return $self->{fields}->{lc $canonical_field};
} else {
croak "No such value, '$field'";
}
Which appears to have stopped the error and does not *appear* to have affected
the operation of the code.