develooper Front page | perl.moose | Postings from January 2016

Re: Annoying warning in Moose::Meta::Attribute; our $VERSION ='2.1604'

Thread Previous
From:
shtil
Date:
January 19, 2016 22:08
Subject:
Re: Annoying warning in Moose::Meta::Attribute; our $VERSION ='2.1604'
Message ID:
1263688158.6275059.1453241319861.JavaMail.zimbra@comcast.net
Unfortunately a quick attempt to isolate the error failed :-). 

The class structure I use is quite complex, used ORM to third party code and is not easy to set up outside of my environment. 

I will see what I can do time permitting. 

----- Original Message -----

From: "Karen Etheridge" <perl@froods.org> 
To: shtil@comcast.net 
Cc: "Moose" <moose@perl.org> 
Sent: Tuesday, January 19, 2016 12:34:11 PM 
Subject: Re: Annoying warning in Moose::Meta::Attribute; our $VERSION = '2.1604' 

Can you possibly provide a bit of code that, when run, reproduces this warning? The 'package' key should normally exist with a defined value. 

many thanks! 

On Mon, Jan 18, 2016 at 10:25 AM, < shtil@comcast.net > wrote: 



Hi, 

I see the following when calling $self->meta->add_attribute in my code under perl 5.10.1: 

Use of uninitialized value in string eq at .../perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Meta/Attribute.pm line 1035. 

I think the following code segment: 



if ( 
$method 
&& !$method->is_stub 
&& !$method->isa('Class::MOP::Method::Accessor') 
&& ( !$self->definition_context 
|| $method->package_name eq $self->definition_context->{package} ) 
) { 




should look like: 




if ( 
$method 
&& !$method->is_stub 
&& !$method->isa('Class::MOP::Method::Accessor') 
&& ( !$self->definition_context 
|| exists(self->definition_context->{package}) && $method->package_name eq $self->definition_context->{package} ) 
) { 

-- 
Yuri 








Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About