my $am_dir = "@datadir@/@PACKAGE@";
# String constants.
-my $IGNORE_PATTERN = "^##([^#].*)?\$";
-my $WHITE_PATTERN = "^[ \t]*\$";
-my $COMMENT_PATTERN = "^#";
-my $TARGET_PATTERN="[\$a-zA-Z_.][-.a-zA-Z0-9_(){}/\$]*";
+my $IGNORE_PATTERN = '^##([^#].*)?$';
+my $WHITE_PATTERN = '^[ \t]*$';
+my $COMMENT_PATTERN = '^#';
+my $TARGET_PATTERN='[$a-zA-Z_.][-.a-zA-Z0-9_(){}/$]*';
my $RULE_PATTERN = "^($TARGET_PATTERN) *:([^=].*|)\$";
-my $SUFFIX_RULE_PATTERN = "^\\.([a-zA-Z0-9]+)\\.([a-zA-Z0-9]+)\$";
+my $SUFFIX_RULE_PATTERN = '^\.([a-zA-Z0-9]+)\.([a-zA-Z0-9]+)$';
# Only recognize leading spaces, not leading tabs. If we recognize
# leading tabs here then we need to make the reader smarter, because
# otherwise it will think rules like `foo=bar; \' are errors.
-my $MACRO_PATTERN = "^ *([A-Za-z0-9_\@]+)[ \t]*([:+]?)=[ \t]*(.*)\$";
-my $BOGUS_MACRO_PATTERN = "^ *([^ \t]*)[ \t]*([:+]?)=[ \t]*(.*)\$";
-my $GNITS_VERSION_PATTERN = "[0-9]+\\.[0-9]+([a-z]|\\.[0-9]+)?";
-my $IF_PATTERN = "^if[ \t]+([A-Za-z][A-Za-z0-9_]*)[ \t]*(#.*)?\$";
-my $ELSE_PATTERN = "^else(?:[ \t]+([A-Za-z][A-Za-z0-9_]*))?[ \t]*(#.*)?\$";
-my $ENDIF_PATTERN = "^endif(?:[ \t]+([A-Za-z][A-Za-z0-9_]*))?[ \t]*(#.*)?\$";
-my $PATH_PATTERN='(\\w|[/.-])+';
+my $MACRO_PATTERN = '^ *([A-Za-z0-9_@]+)[ \t]*([:+]?)=[ \t]*(.*)$';
+my $BOGUS_MACRO_PATTERN = '^ *([^ \t]*)[ \t]*([:+]?)=[ \t]*(.*)$';
+my $GNITS_VERSION_PATTERN = '[0-9]+\.[0-9]+([a-z]|\.[0-9]+)?';
+my $IF_PATTERN = '^if[ \t]+([A-Za-z][A-Za-z0-9_]*)[ \t]*(#.*)?$';
+my $ELSE_PATTERN = '^else(?:[ \t]+([A-Za-z][A-Za-z0-9_]*))?[ \t]*(#.*)?$';
+my $ENDIF_PATTERN = '^endif(?:[ \t]+([A-Za-z][A-Za-z0-9_]*))?[ \t]*(#.*)?$';
+my $PATH_PATTERN='(\w|[/.-])+';
# This will pass through anything not of the prescribed form.
-my $INCLUDE_PATTERN = "^include[ \t]+((\\\$\\\(top_srcdir\\\)/${PATH_PATTERN})|(\\\$\\\(srcdir\\\)/${PATH_PATTERN})|([^/\\\$]${PATH_PATTERN}))[ \t]*(#.*)?\$";
+my $INCLUDE_PATTERN = ('^include[ \t]+'
+ . '((\$\(top_srcdir\)/' . $PATH_PATTERN . ')'
+ . '|(\$\(srcdir\)/' . $PATH_PATTERN . ')'
+ . '|([^/\$]' . $PATH_PATTERN. '))[ \t]*(#.*)?$');
# Some regular expressions. One reason to put them here is that it
# makes indentation work better in Emacs.
-my $AC_CONFIG_AUX_DIR_PATTERN = "AC_CONFIG_AUX_DIR\\(([^)]+)\\)";
-my $AM_INIT_AUTOMAKE_PATTERN = "AM_INIT_AUTOMAKE\\([^,]*,([^,)]+)[,)]";
-my $AM_PACKAGE_VERSION_PATTERN = "^\\s*\\[?([^]\\s]+)\\]?\\s*\$";
+my $AC_CONFIG_AUX_DIR_PATTERN = 'AC_CONFIG_AUX_DIR\(([^)]+)\)';
+my $AM_INIT_AUTOMAKE_PATTERN = 'AM_INIT_AUTOMAKE\([^,]*,([^,)]+)[,)]';
+my $AM_PACKAGE_VERSION_PATTERN = '^\s*\[?([^]\s]+)\]?\s*$';
# Note that there is no AC_PATH_TOOL. But we don't really care.
-my $AC_CHECK_PATTERN = "AC_(CHECK|PATH)_(PROG|PROGS|TOOL)\\(\\[?(\\w+)";
-my $AM_MISSING_PATTERN = "AM_MISSING_PROG\\(\\[?(\\w+)";
+my $AC_CHECK_PATTERN = 'AC_(CHECK|PATH)_(PROG|PROGS|TOOL)\(\[?(\w+)';
+my $AM_MISSING_PATTERN = 'AM_MISSING_PROG\(\[?(\w+)';
# Just check for alphanumeric in AC_SUBST. If you do AC_SUBST(5),
# then too bad.
-my $AC_SUBST_PATTERN = "AC_SUBST\\(\\[?(\\w+)";
-my $AM_CONDITIONAL_PATTERN = "AM_CONDITIONAL\\((\\w+)";
+my $AC_SUBST_PATTERN = 'AC_SUBST\(\[?(\w+)';
+my $AM_CONDITIONAL_PATTERN = 'AM_CONDITIONAL\(\[?(\w+)';
# Constants to define the "strictness" level.
my $FOREIGN = 0;