Skip Menu |

This queue is for tickets about the MooseX-Storage CPAN distribution.

Report information
The Basics
Id: 68358
Status: rejected
Priority: 0/
Queue: MooseX-Storage

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

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



Subject: Argument "6.78_99" isn't numeric in numeric eq (==) at MooseX/Storage/Engine.pm
Version comparison fails on MooseX::Storage::Engine when an attribute is an object also using MooseX::Storage and has an alpha version as in the attached example: $ perl point.pl p1: x=1 y=2 Argument "6.78_99" isn't numeric in numeric eq (==) at /home/alexm/perl5/perlbrew/perls/uoc-perl/lib/site_perl/5.12.2/MooseX/Storage/Engine.pm line 183. Argument "6.78_99" isn't numeric in numeric eq (==) at /home/alexm/perl5/perlbrew/perls/uoc-perl/lib/site_perl/5.12.2/MooseX/Storage/Engine.pm line 183. p2: x=1 y=2 Using version module on both operands before comparison should fix this issue for alpha version numbers. Thanks!
Subject: point.pl
#!perl use strict; use warnings; package Point; use Moose; use MooseX::Storage; our $VERSION = '1.23_45'; with Storage; has 'x' => (is => 'rw', isa => 'Int'); has 'y' => (is => 'rw', isa => 'YPoint'); package YPoint; use Moose; use MooseX::Storage; our $VERSION = '6.78_99'; with Storage; has value => (is => 'rw', isa => 'Int'); package main; my $p1 = Point->new( x => 1, y => YPoint->new( value => 2 ) ); my $pack = $p1->pack(); print "p1: x=", $pack->{x}, " y=", $pack->{y}{value}, "\n"; my $p2 = Point->unpack($pack); print "p2: x=", $p2->x, " y=", $p2->y->value, "\n"; __END__
I don't believe this is a bug; $VERSIONs should always be numeric (or vstrings, which can be treated as numeric). Changing your code thusly, as per current best practices with version numbers, will fix things: our $VERSION = '1.23_01'; $VERSION = eval $VERSION;