Skip Menu |

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

Report information
The Basics
Id: 42894
Status: resolved
Priority: 0/
Queue: Geo-Point

People
Owner: Nobody in particular
Requestors: mail [...] petschge.de
Cc:
AdminCc:

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



Subject: Accessor ->x broken in new version
Date: Thu, 29 Jan 2009 13:52:19 +0100
To: bug-Geo-Point [...] rt.cpan.org
From: Patrick Kilian <mail [...] petschge.de>
Hi all, after an Update of Geo::Line and Geo::Point the following code stopped working: my @points = $line->points; my $ax = ($points[0])->x; the resulting error message is: Can't call method "x" on unblessed reference at... changing the code slightly to: my @points = $line->points; my $ax = ($points[0])->[0]; fixes the problem. Looks like the new version of Geo::Line has broken blessing or something. Unfortunatly I can't find out which version I had before. But it was a couple of month since the last update. Petschge
Subject: Re: [rt.cpan.org #42894] Accessor ->x broken in new version
Date: Thu, 29 Jan 2009 23:37:06 +0100
To: Patrick Kilian via RT <bug-Geo-Point [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Patrick Kilian via RT (bug-Geo-Point@rt.cpan.org) [090129 17:44]: Show quoted text
> Thu Jan 29 12:44:15 2009: Request 42894 was acted upon. > Transaction: Ticket created by mail@petschge.de > Queue: Geo-Point > Subject: Accessor ->x broken in new version > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: mail@petschge.de > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=42894 > > > after an Update of Geo::Line and Geo::Point the following code stopped > working: > > my @points = $line->points; > my $ax = ($points[0])->x; > > the resulting error message is: > Can't call method "x" on unblessed reference at... > > changing the code slightly to: > my @points = $line->points; > my $ax = ($points[0])->[0]; > > fixes the problem. > > Looks like the new version of Geo::Line has broken blessing or > something. Unfortunatly I can't find out which version I had before. But > it was a couple of month since the last update.
During the initial development of Geo::Point, I changed my idea a bit... but there were some spots where I did not repair the changes. The concept is to have only one projection definition per object. Uptil the latest release, when you constructed a line from GeoPoints, you got a line object which contained geopoint objects. But when a line was constructed from x,y pairs, it was kept as such. This was not acceptable. That got fixed, to behave as documented. You could change your code into my @points = $line->geopoints; my $ax = $points[0]->x; or better my $ax = $line->geopoint(0)->x; -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions drs Mark A.C.J. Overmeer MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
not a bug