my %results = map { /^([^=]*)(?:(=)(#)?(.*))?/s; ($1, ($3 ? fn($4) : ($2 ? $4 : fn($1)))) } split(/,/, $string);