[mrtg-developers] Re: perl compatibity

Lorenzo Colitti lorenzo at colitti.com
Fri Jun 20 15:53:39 MEST 2003


Simon Leinen wrote:
> I don't like this change too much (and it's a change to my code):
> 
>>+	no strict "subs";
>> 	$ipv6_addr_len = length(pack_sockaddr_in6(161, inet_pton(AF_INET6, "::1")));
>>+	use strict "subs";
> 
> Why don't you simply write "AF_INET6()" instead of "AF_INET6"?
> 
> Doesn't that work on all versions?

I didn't write AF_INET6() because I didn't know you could do it! :-)
I'm no Perl expert, unfortunately.

AF_INET6() does seem to work both on Perl 5.6.1 and 5.8.0, with and 
without IPv6, but I don't know about 5.005 as I don't have it.

Tobi, maybe you have an installation of 5.005 you can test it on? You 
would just need to back out the patch-SNMP_Session-bareword I sent you 
the day before yesterday, then change this line in SNMP_Session.pm:

>  	$ipv6_addr_len = length(pack_sockaddr_in6(161, inet_pton(AF_INET6, "::1")));

(should be around line 127) to this:

>  	$ipv6_addr_len = length(pack_sockaddr_in6(161, inet_pton(AF_INET6(), "::1")));

and then see if cfgmaker and/or mrtg still work on 5.6.0.

There are a couple more "no strict subs; foo(AF_INET6); use strict 
subs;" in SNMP_Session.pm, and I think there's one more in MRTG. If 
AF_INET6() is found to work on 5.005, perhaps we should remove all of 
them? Simon, Tobi, what do you think? I can whip up a patch if you like.


Regards,
Lorenzo

--
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