Re: Annoying warning in Moose::Meta::Attribute; our $VERSION = '2.1604'
[email protected] (Karen Etheridge) Tue, 19 Jan 2016 12:34:11 -0800
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <CAPJsHfChKw-GnaMfhB8HB0rAGh3_rwfYHHoT+jBnwF4TGJLhew@mail.gmail.com> |
--089e0141a0aecf2ea30529b5ca2e Content-Type: text/plain; charset=UTF-8 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, <[email protected]> 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 > > > --089e0141a0aecf2ea30529b5ca2e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Can you possibly provide a bit of code that, when run= , reproduces this warning?=C2=A0 The 'package' key should normally = exist with a defined value.<br><br></div>many thanks!<br></div><div class= =3D"gmail_extra"><br><div class=3D"gmail_quote">On Mon, Jan 18, 2016 at 10:= 25 AM, <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target= =3D"_blank">[email protected]</a>></span> wrote:<br><blockquote class=3D= "gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding= -left:1ex"><div><div style=3D"font-family:Arial;font-size:12pt;color:#00000= 0"><div>Hi,</div><div><br></div><div>I see the following when calling=C2=A0= =C2=A0$self->meta->add_attribute in my code under perl 5.10.1:</div><= div><br></div><div>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.</di= v><div><br></div><div>I think the following code segment:</div><div><br></d= iv><div><p style=3D"margin:0px">if (<br> $method<br> && !$method-&g= t;is_stub<br> && !$method->isa('Class::MOP::Method::Accessor= ')<br> && ( !$self->definition_context<br> || $method->pa= ckage_name eq $self->definition_context->{package} )<br> ) {</p><p st= yle=3D"margin:0px"><br></p><p style=3D"margin:0px">should look like:</p><p = style=3D"margin:0px"><br></p><p style=3D"margin:0px">if (<br> $method<br> &= amp;& !$method->is_stub<br> && !$method->isa('Class::= MOP::Method::Accessor')<br> && ( !$self->definition_context<= br> || exists(self->definition_context->{package}) =C2=A0&&= =C2=A0$method->package_name eq $self->definition_context->{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></= div></blockquote></div><br></div> --089e0141a0aecf2ea30529b5ca2e--