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 "' : '").
In reply to Re^2: Python dict to perl hash
by frozenwithjoy
in thread Python dict to perl hash
by garg10may
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |