http://qs321.pair.com?node_id=1121851


in reply to Re: Python dict to perl hash
in thread Python dict to perl hash

I think replacing this:

$x =~ s/['\s+]//g; my %hash = split /[:,]/, $x;

with this:

$x =~ s/'\s*:\s*'/' => '/g; my %hash = %{ eval "{$x}" };

would make it less breakable (but still breakable if and keys or values contained something like "' : '").