Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Request for Perl::Critic Testimonials (some weirdnesses of the module)

by Ieronim (Friar)
on Jul 15, 2006 at 21:01 UTC ( #561491=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Request for Perl::Critic Testimonials (some weirdnesses of the module)
in thread Request for Perl::Critic Testimonials

You decided that my English is so poor that i can't read the docs of Perl::Critic and understand why these warnings appeared? ;)

Your comment contains many errors :( Yes, if i modify my code according to your recommendations, Perl::Critic will stop complainingóbut my code will stop working :)

Your recommendation to use

next if /^;/xms;
is very weird. The using of /s and /m switches together causes a very unexpected interpretation of the RegEx:

perlretut says:
both s and m modifiers (//sm): Treat string as a single long line, but detect multiple lines. '.' matches any character, even "\n". ^ and $, however, are able to match at the start or end of any line within the string.

Do you still think that it's a good idea to add /ms to the end of each regex?

Don't use local variables, use my. Don't the special variables like $", use the English module.
use English qw( -no_match_vars ); my $LIST_SEPERATOR = q{|};

  1. The Perl built-in variables lose their magic capabilities when declared as my. Didn't you know?
  2. There is no $LIST_SEPERATOR. Use $LIST_SEPARATOR instead.
  3. If you don't believe me, try the following code:
    #!/usr/bin/perl use warnings; use strict; use English qw( -no_match_vars ); { local $LIST_SEPARATOR = q{!}; my @list = qw/this is my list/; print "@list\n"; }
    and then try to replace 'local' with 'my'.
    BTW, Perl::Critic does not complain about local'ising in the code above ;)

      s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print


Comment on Re^3: Request for Perl::Critic Testimonials (some weirdnesses of the module)
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2014-10-24 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (130 votes), past polls