- or download this
@chunks = split /\), ([A-Z][A-Z])\(/, $input;
- or download this
@chunks = split /(?: (?:^|\),\s) ([A-Z][A-Z])\( | \)$)/x, $input;
shift @chunks; # remove extra blank element at front
- or download this
use List::MoreUtils qw(part);
my @chunks = ...; # as above
...
# or
my %text = @chunks;
say "Text value AF is $text{AF}";