in reply to Adapting parenthesis in regexps

split works best when you have a list joined by a seperator, and you split on the seperator.

sub unbracket { for (my $s = @_ ? $_[0] : $_) { s/^<//; s/>$//; return $_; } } my %hash = map unbracket, map { split /=/ } split /, /, $_; # Or just # my %hash = map unbracket, split /, |=/, $_;