Category Archives: 5.30

Match Unicode property values with a wildcard

Not all characters with a numerical value are “digits”, in the Perl sense. You saw in Match Unicode characters by property value, in which you selected characters by a Unicode property value. That showed up again in Perl v5.18 adds character class set operations. Perl v5.30 adds a slightly easier way to get at multiple […]

Use a variable-width lookbehind if it won’t match more than 255 characters

In Ignore part of a substitution’s match, I showed you the match resetting \K—it’s basically a variable-width positive lookbehind assertion. It’s a special feature to work around Perl’s lack of variable-width lookbehinds. However, v5.30 adds an experimental feature to allow a limited version of a variable-width lookbehind.

Perl 5.30 fixes single quoted qr” with \N{}

The qr// operator allows you to compile a regular expression without applying it to anything. You get the pattern without the match, and you can reuse the pattern as often as you like. Before v5.30, it had an inconsistency with \N{} sequences, but that’s fixed now.

No more false postfix lexical declarations in v5.30

Before Perl v5.10 introduced state variables, people did various things to create persistent lexical variables for a subroutine. With v5.30, one of those constructs is now a fatal error. Often you want a persistent variable to be scoped and private to a subroutine. But, once you leave that scope, normal lexical variables disappear because their […]

Perl v5.30 new features

Perl v5.29 is the development series leading up to the maintenance release v5.30 sometime in the middle of 2019. As it’s released—roughly monthly—you can get a peek at what’s coming up. You can track the progress by reading the perldelta documentation that comes with each Perl release (although you’ll need to select the development version […]

Perl v5.30 lets you match more with the general quantifier

Does the {N,} really match infinite repetitions in a Perl regular expression? No, it never has. You’ve been limited to 32,766 repetitions. Perl v5.30 is about to double that for you. And, if you are one of the people who needed more, I’d like to hear your story.