How has support for named captures changed across recent Perl versions?

In recent Perl versions, support for named captures has significantly improved, enabling more flexible and clearer regular expression handling. Named captures allow you to assign a name to a capturing group, making it easier to reference the captured values later on.
named captures, Perl, regex, regular expressions, programming
# Example of named captures in Perl my $text = "Name: John, Age: 30"; if ($text =~ /Name: (?\w+), Age: (?\d+)/) { print "Captured name: $+{name}\n"; print "Captured age: $+{age}\n"; }

named captures Perl regex regular expressions programming