Bug#735682: libgeo-distance-perl: error in SYNOPSIS

Niko Tyni ntyni at debian.org
Fri Jan 17 14:15:04 UTC 2014


Package: libgeo-distance-perl
Version: 0.20-1
Severity: minor
Tags: patch

The reg_unit() call in Geo::Distance SYNOPSIS is wrong. Quoting:

         use Geo::Distance;
         my $geo = new Geo::Distance;
         $geo->formula('hsin');
         $geo->reg_unit( 'toad_hop', 200120 );

Consider:

% perl -MGeo::Distance -le 'my $g = Geo::Distance->new; $g->reg_unit( "toad_hop", 200120 ); print $g->distance("toad_hop", (0,0), (1,1))'
Use of uninitialized value in multiplication (*) at /usr/share/perl5/Geo/Distance.pm line 214.
0

The radius should come first and the name next in the reg_unit() call:

% perl -MGeo::Distance -le 'my $g = Geo::Distance->new; $g->reg_unit( 200120, "toad_hop" ); print $g->distance("toad_hop", (0,0), (1,1))'
4939.3731251203

The rest of the documentation seems to be correct. Proposed patch attached.
-- 
Niko Tyni   ntyni at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-incorrect-reg_unit-example-in-SYNOPSIS.patch
Type: text/x-diff
Size: 945 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20140117/69b935ff/attachment.patch>


More information about the pkg-perl-maintainers mailing list