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.
this post was submitted on 20 Jun 2023
2 points (100.0% liked)
Perl
184 readers
1 users here now
founded 1 year ago
MODERATORS
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?
view more: next ›