After compiling and installing GNU automake 1.15, I get this error whenever I run automake:

Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/
at /usr/local/bin/automake line 3936

I am running perl v5.22.0.

  • This problem has cropped up in Creating config file /etc/logrotate.d/postgresql-common with new version Building PostgreSQL dictionaries from installed myspell/hunspell packages... en_us Removing obsolete dictionary files: Setting up postgresql-9.5 (9.5.11-0ubuntu0.16.04) ... Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78. Also because @bill-cole's answer is most relevant. – Derrell Durrett Feb 18 at 18:51

In perl v5.22, using a literal { in a regular expression was deprecated, and will emit a warning if it isn't escaped: \{. In v5.26, this won't just warn, it'll cause a syntax error.

The author of the software will need to fix this before the 5.26 release. For now, you can safely ignore this warning.

See perldelta for details.

This is due to the change described in [perldelta][http://search.cpan.org/dist/perl-5.22.0/pod/perldelta.pod#A_literal_%22%7B%22_should_now_be_escaped_in_a_pattern "Perl Changes for 5.22"] but the solution suggested there of escaping the '{' is frequently not the right thing to do, depending on the intended logic of the regex.

This warning occurs when a regex uses a construct like "{,20}" which historically in some OTHER regex implementations has been interpreted as equivalent to "{0,20}", i.e. "a repeating series of the preceding atom, zero to twenty times." In all cases where the intent is to quantify a repeat, this is broken in all modern versions of Perl, because interpretation of '{' followed by anything other than a number as a literal '{' has been explicitly documented since 5.8. Escaping the left brace in the case of an intended quantifier isn't the fix; adding the implied zero is.

This was fixed on 2016-04-01 (after automake 1.15, before 1.15.1).

From the ChangeLog:

  966 2016-04-01  Paul Eggert  <eggert@cs.ucla.edu>
  967 
  968   automake: port to Perl 5.22 and later
  969 
  970   Without this change, Perl 5.22 complains "Unescaped left brace in
  971   regex is deprecated" and this is planned to become a hard error in
  972   Perl 5.26.  See:
  973   http://search.cpan.org/dist/perl-5.22.0/pod/perldelta.pod#A_literal_%22{%22_should_now_be_escaped_in_a_pattern
  974   * bin/automake.in (substitute_ac_subst_variables): Escape left brace.

I got this error just because I was using by mistake 'print' instead of echo in bash:

print "abcd123" | perl -e 'myscript'  #causes error

Solution was use echo, I just confused print/echo by mixing languages

echo "abcd123" | perl -e 'myscript'  #is fine
printf "abcd123" | perl -e 'myscript'  #is fine too, "printf" not print

Problem seems to be fixes with automake 1.15.1

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.