[mrtg-developers] Re: perl compatibity

Lorenzo Colitti lorenzo at colitti.com
Wed Jun 18 15:59:13 MEST 2003


Tobias Oetiker wrote:
> I just found that the patched SNMP_Session.pm does not work with
> perl 5.6 anymore. What's interesting, is that it breaks at the
> 
> no strict 'subs';
> 
> line which claims to be there exactly FOR compatibility.
> 
> I am not exactly sure why it breaks, because according to perldoc
> for 5.6 it should work ...

Hi Tobi,

yes, that's my fault. The problem is that there is a bare AF_INET6 in 
the first BEGIN block (see attached patch).

It took me a while to find it, as Perl 5.6 unhelpfully reports niether 
the actual error (should be 'Bareword "AF_INET6" not allowed while 
"strict subs" in use'), nor the line number where the error actually 
occurs (the line 571 it does report is just a red herring).

I think Perl is getting confused by the fact that the error happens in 
an eval block inside a BEGIN block and is not setting $@. This may or 
may not be related to Perl bug #18479 (perhaps not, because that bug is 
reported as fixed only in 5.9.0, but perhaps so, because Perl > 5.6 has 
AF_INET6 defined in Socket.pm, and so wouldn't think it was a bareword 
anyway).

One way or the other, the patch fixes the problem on my Red Hat 7.2 box 
which uses Perl 5.6.1. Let me know if it works on your 5.6 as well.


Regards,
Lorenzo


-- Attached file removed by Ecartis and put at URL below --
-- Type: text/plain
-- Size: 538 bytes
-- URL : http://www.ee.ethz.ch/~slist/p/patch-SNMP_Session-bareword


--
Unsubscribe mailto:mrtg-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/mrtg-developers



More information about the mrtg-developers mailing list