I really like how easy it is to use regex in Perl with =~. I've always wondered why that's not the case in Go and Rust where I need to compile the regex using non-std library.
Perl
Agreed. Though I’m very comfortable using RE, I’ve still never used it with backtracking or recursion. I always feel like I can go much deeper in Perl, though 99% of what I need to do doesn’t require it.
Oh wow I've written Perl since 92-93. But I don't think I've never seen nor user the r
option.
For grouped replacements like that I've tended to localise $_
.
Which is pretty much the only useful use of local
I can think of.
Non-destructive substitution was introduced in Perl 5.14 (released in 2011) so it's not surprising you haven't heard of it if you've been programming perl for years before that. Especially if you're not always reading every single release announcement.
Hanging out on the Perl Slack and Discord channels is fun because there's always someone out there who drops one of these kind of obscure but incredibly useful features when someone asks for help.
Where do I find this slack and discord? asking for a friend...
edit: I found "Perl Hideout" ... is that one?