>perl -wMstrict -le "my $s = '{key_1 : value_1}{key_2 : value of 2} {key n : 0}'; my $spl = qr{ \s* [{}:] \s* }xms; my %hash = grep length($_), split $spl, $s; use Data::Dumper; print Dumper \%hash; " $VAR1 = { 'key_1' => 'value_1', 'key_2' => 'value of 2', 'key n' => '0' };