in reply to Re^2: Converting between network and dotted quad. Issue with << and >> operators between Perl Versions.
in thread Converting between network and dotted quad. Issue with << and >> operators between Perl Versions.

Like I mentioned in the CB, you reinvented inet_aton and inet_ntoa.
use Socket qw( inet_aton inet_ntoa ); sub dotted_quad_to_network { return unpack 'N', inet_aton $_[0] } sub network_to_dotted_quad { return inet_ntoa pack 'N', $_[0] }
  • Comment on Re^3: Converting between network and dotted quad. Issue with << and >> operators between Perl Versions.
  • Select or Download Code