in reply to How to create a hash from string

I am not sure whether the sqare brackets are part of the input. The following code works for both alternatives. It uses the fact that a hash can be created from a list by just interpreting each odd element as a key and each even element as its value.
#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my $string = 'x:q,y:u,z:n'; my %hash = split /[:,]/, $string; print Dumper \%hash; $string = '[x:q,y:u,z:n]'; %hash = split /[:,]/, substr $string, 1, -1; print Dumper \%hash;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ