Skip Menu |

This queue is for tickets about the Geo-Shapefile-Writer CPAN distribution.

Report information
The Basics
Id: 99744
Status: resolved
Priority: 0/
Queue: Geo-Shapefile-Writer

People
Owner: Nobody in particular
Requestors: SLAFFAN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: avoid sprintf warning under 5.21+
Perl 5.21 introduces warnings when sprintf does not use all passed arguments. This is triggered in Geo::Shapefile::Writer::_get_header. The attached patch avoids the warning by subscripting to use only the first two items in the passed array. Regards, Shawn.
Subject: Writer.pm.patch
Index: lib/Geo/Shapefile/Writer.pm =================================================================== --- lib/Geo/Shapefile/Writer.pm (revision 16) +++ lib/Geo/Shapefile/Writer.pm (working copy) @@ -144,7 +144,7 @@ map {[ $_->[0], $_->[1], $_->[2] && ($self->{$_->[2]} // $self->{"$file_type$_->[2]"}) // $_->[3] ]} @header_fields; - my $pack_string = join q{ }, map { sprintf '@%d%s', @$_ } (@use_fields, [$header_size, q{}]); + my $pack_string = join q{ }, map { sprintf '@%d%s', @$_[0,1] } (@use_fields, [$header_size, q{}]); return pack $pack_string, map { $_->[2] } @use_fields; } }
fixed, thanks