http://qs321.pair.com?node_id=11132930


in reply to Re^5: Perl 5.34 is released
in thread Perl 5.34 is released

> again

Orly?

So please explain!

$ perl -Mstrict -wE 'my $str = "foobar"; say 1 if $str =~ /{,3}/; say +$]' 5.028002 $

(Update perl version added)

update

>perl -Mstrict -wE "my $str = 'foobar'; say 1 if $str =~ /{,3}/; say $ +],':',$^O" 5.032001:MSWin32

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^7: Perl 5.34 is released
by jeffenstein (Hermit) on Jun 02, 2021 at 20:55 UTC

    I would guess there's a special case when the brace is the first character in the regex.

    $ perl -wE 'say $]; say "Match literal" if "{,3}" =~ m<{,3}> && "x" !~ + m<{,3}>;' 5.030001 Match literal $ perl -wE 'say $]; say "Match space" if " {,3}" =~ m< {,3}> && "x" !~ + m< {,3}>;' Unescaped left brace in regex is illegal here in regex; marked by <-- +HERE in m/ { <-- HERE ,3}/ at -e line 1.
      What's happening is that the space must be repeated.

        $ perl -wE 'say $]; say "Match space" if " " =~ m< {0,3}>' 5.028002 Match space $

      Your error is thrown because {,3} is illegal as quantifier for Perl <5.34

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery