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

[email protected] Mon, 18 Jan 2016 18:25:54 +0000 (UTC)
Newsgroups perl.moose
Message-ID <[email protected]>
------=_Part_5368071_52935898.1453141554104
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

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 



------=_Part_5368071_52935898.1453141554104
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><body><div style=3D"font-family: Arial; font-size: 12pt; color: #0000=
00"><div aria-label=3D"Compose body">Hi,</div><div aria-label=3D"Compose bo=
dy"><br></div><div aria-label=3D"Compose body">I see the following when cal=
ling&nbsp;&nbsp;$self-&gt;meta-&gt;add_attribute in my code under perl 5.10=
.1:</div><div aria-label=3D"Compose body"><br></div><div aria-label=3D"Comp=
ose body">Use of uninitialized value in string eq at .../perl-5.10.1/lib/si=
te_perl/5.10.1/x86_64-linux/Moose/Meta/Attribute.pm line 1035.</div><div ar=
ia-label=3D"Compose body"><br></div><div aria-label=3D"Compose body">I thin=
k the following code segment:</div><div aria-label=3D"Compose body"><br></d=
iv><div aria-label=3D"Compose body"><p style=3D"margin: 0px;" data-mce-styl=
e=3D"margin: 0px;">if (<br> $method<br> &amp;&amp; !$method-&gt;is_stub<br>=
 &amp;&amp; !$method-&gt;isa('Class::MOP::Method::Accessor')<br> &amp;&amp;=
 ( !$self-&gt;definition_context<br> || $method-&gt;package_name eq $self-&=
gt;definition_context-&gt;{package} )<br> ) {</p><p style=3D"margin: 0px;" =
data-mce-style=3D"margin: 0px;"><br></p><p style=3D"margin: 0px;" data-mce-=
style=3D"margin: 0px;">should look like:</p><p style=3D"margin: 0px;" data-=
mce-style=3D"margin: 0px;"><br></p><p style=3D"margin: 0px;" data-mce-style=
=3D"margin: 0px;">if (<br> $method<br> &amp;&amp; !$method-&gt;is_stub<br> =
&amp;&amp; !$method-&gt;isa('Class::MOP::Method::Accessor')<br> &amp;&amp; =
( !$self-&gt;definition_context<br> || exists(self-&gt;definition_context-&=
gt;{package}) &nbsp;&amp;&amp;&nbsp;$method-&gt;package_name eq $self-&gt;d=
efinition_context-&gt;{package} )<br> ) {</p></div><div><br></div><div>--</=
div><div>Yuri</div><div><span name=3D"x"></span><span name=3D"x"></span><br=
></div><div><br></div></div></body></html>
------=_Part_5368071_52935898.1453141554104--