# As the documentation says, this policy is not for everyone!
[-RegularExpressions::ProhibitEnumeratedClasses]
-# This would be okay if it did not flag alternations of mixed single and
-# multiple characters. For example, it wants to combine the 'h' and '?' here:
-# /^-(help|h|\?)$/i
-# which would make it harder to read
-[-RegularExpressions::ProhibitSingleCharAlternation]
-
# Disagree. Double quotes are easier to read than single quotes and allow a
# uniform style for quotes. My editor has color coding which indicates
# interpolation. Double quotes do not increase processing time by any
elsif ( $i =~ /^-(pro|profile)=?$/ ) {
Die("usage: -pro=filename or --profile=filename, no spaces\n");
}
- elsif ( $i =~ /^-(help|h|\?)$/i ) {
+ elsif ( $i =~ /^-(?: help | [ h \? ] )$/xi ) {
usage();
Exit(0);
}
# The first test here very significantly speeds things up, but be sure to
# keep the regex and hash %other_line_endings the same.
if ( $other_line_endings{ substr( $input_line, -1 ) } ) {
- if ( $input_line =~ s/((\r|\035|\032)+)$// ) {
- $input_line_separator = $2 . $input_line_separator;
+ if ( $input_line =~ s/([\r\035\032])+$// ) {
+ $input_line_separator = $1 . $input_line_separator;
}
}
$max_token_index );
}
- if ( $next_nonblank_token =~ /(\(|\$|\w|\.|\@)/ ) {
+ if ( $next_nonblank_token =~ / [ \( \$ \w \. \@ ] /x ) {
$is_possible_numerator = 1;
}
elsif ( $next_nonblank_token =~ /^\s*$/ ) {