in reply to customized JSON pretty print
As soon your array had too many, probably long entries, you'd complain again about a messed up long unreadable line.
That's why Data::Dump has a heuristic to inline short arrays with short entries.
IMHO you can only ask a feature request at the maintainer of JSON.pm.
perl -MData::Dump -e'@a=("aaa","bbb","ccc"); @b=(@a)x4; dd \@a,\@b' ( ["aaa", "bbb", "ccc"], [ "aaa", "bbb", "ccc", "aaa", "bbb", "ccc", "aaa", "bbb", "ccc", "aaa", "bbb", "ccc", ], )
Data::Dumper OTOH doesn't have that heuristic, only global switches like you are asking for.
Do you see the problem?
|
|---|