in reply to Problem with perlcritic when using Moose object
Edited (again): As haukex points out in his reply, I've apparently just been paranoiac without a good reason. There's nothing wrong with an unquoted shift within braces, the following advice can safely be scratched.
Instead of if($hash->{shift}) { $Person->shift( $hash->{shift} ); } use:The Perl parser could confuse the bareword shift in the braces with its core function shift instead of converting it to a string. (edited because I tested the stuff and found out that it does not confuse it right now).if($hash->{'shift'}) { $Person->shift( $hash->{'shift'} ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with perlcritic when using Moose object
by haukex (Archbishop) on Oct 05, 2018 at 15:07 UTC | |
by haj (Vicar) on Oct 06, 2018 at 09:29 UTC | |
by haukex (Archbishop) on Oct 06, 2018 at 09:42 UTC | |
by haj (Vicar) on Oct 06, 2018 at 19:47 UTC | |
|
Re^2: Problem with perlcritic when using Moose object
by Anonymous Monk on Oct 05, 2018 at 20:04 UTC |