Re: Annoying warning in Moose::Meta::Attribute; our $VERSION = '2.1604'
[email protected] Tue, 19 Jan 2016 22:08:39 +0000 (UTC)
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_6275058_501201556.1453241319860 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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" <[email protected]> To: [email protected] Cc: "Moose" <[email protected]> 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, < [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 ------=_Part_6275058_501201556.1453241319860 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">Unfortunately a quick attempt to isola= te the error failed :-).</div><div aria-label=3D"Compose body"><br></div><d= iv aria-label=3D"Compose body">The class structure I use is quite complex, = used ORM to third party code and is not easy to set up outside of my enviro= nment.</div><div aria-label=3D"Compose body"><br></div><div aria-label=3D"C= ompose body">I will see what I can do time permitting.</div><div><br></div>= <hr id=3D"zwchr"><div style=3D"color:#000;font-weight:normal;font-style:nor= mal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:1= 2pt;" data-mce-style=3D"color: #000; font-weight: normal; font-style: norma= l; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-siz= e: 12pt;"><b>From: </b>"Karen Etheridge" <[email protected]><br><b>To: = </b>[email protected]<br><b>Cc: </b>"Moose" <[email protected]><br><b>Se= nt: </b>Tuesday, January 19, 2016 12:34:11 PM<br><b>Subject: </b>Re: Annoyi= ng warning in Moose::Meta::Attribute; our $VERSION =3D '2.1604'<br><div><br= ></div><div dir=3D"ltr"><div>Can you possibly provide a bit of code that, w= hen run, reproduces this warning? The 'package' key should normally e= xist with a defined value.<br><div><br></div></div>many thanks!<br></div><d= iv class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Mon, Jan 18, 201= 6 at 10:25 AM, <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" t= arget=3D"_blank" data-mce-href=3D"mailto:[email protected]">[email protected]= et</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"marg= in:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style= =3D"margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><d= iv><div style=3D"font-family:Arial;font-size:12pt;color:#000000" data-mce-s= tyle=3D"font-family: Arial; font-size: 12pt; color: #000000;"><div>Hi,</div= ><div><br></div><div>I see the following when calling $self->= meta->add_attribute in my code under perl 5.10.1:</div><div><br></div><d= iv>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.</div><div><br></div= ><div>I think the following code segment:</div><div><br></div><div><p style= =3D"margin:0px" data-mce-style=3D"margin: 0px;">if (<br> $method<br> &&= amp; !$method->is_stub<br> && !$method->isa('Class::MOP::Meth= od::Accessor')<br> && ( !$self->definition_context<br> || $metho= d->package_name eq $self->definition_context->{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 sty= le=3D"margin:0px" data-mce-style=3D"margin: 0px;"><br></p><p style=3D"margi= n:0px" data-mce-style=3D"margin: 0px;">if (<br> $method<br> && !$me= thod->is_stub<br> && !$method->isa('Class::MOP::Method::Acces= sor')<br> && ( !$self->definition_context<br> || exists(self->= ;definition_context->{package}) && $method->packag= e_name eq $self->definition_context->{package} )<br> ) {</p></div><di= v><br></div><div>--</div><div>Yuri</div><div><span></span><span></span><br>= </div><div><br></div></div></div></blockquote></div><br></div></div><div><b= r></div></div></body></html> ------=_Part_6275058_501201556.1453241319860--