Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Problem with perlcritic when using Moose object

by Veltro (Hermit)
on Oct 04, 2018 at 15:26 UTC ( [id://1223534]=note: print w/replies, xml ) Need Help??


in reply to Problem with perlcritic when using Moose object

It is important to mention the Perl version that you are using. In Perl 5.26.2 MSWin32-x64-multi-thread I receive different compilation errors then yours.

E.g. Experimental shift on scalar is now forbidden at ... line .., near "shift ;"

I believe the error is cause by the contents of $hash and you are not showing the contents which makes it hard to understand the problem you are looking at. Also, the actual shift operation that causes the problem is not shown in your example code. The error you mentioned does not show where it is coming from.

And AFAICS there is no problem in your example code except for the fact that I personally would never use hash keys and method names that belong to the base instruction set of the Perl programming language.

  • Comment on Re: Problem with perlcritic when using Moose object

Replies are listed 'Best First'.
Re^2: Problem with perlcritic when using Moose object
by bangor (Monk) on Oct 04, 2018 at 15:42 UTC
    I don't think it is caused by the contents of $hash as the same error is reported when $Person->shift('one') is called.

    I think it is caused by the use of the keyword 'shift', and it is picked up by perlcritic as an attempt to dereference. And yes, I would never use that as a hash key either - note: I didn't write this code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1223534]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2026-04-11 16:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.