1 2 3 4 5 6 7 8
my $rs = $manager->get_all(query ....; my @hashes = map { +{ value => $_->name, label => $_->name, id => $_->id, } } @{ $rs } ;
1
2
[{"value":"Conrad Electronic SE","id":7487,"label":"Conrad Electronic SE"}]
[{"label":"Conrad Electronic SE","id":7487,"value":"Conrad Electronic SE"}]
to_json(\@hashes, {canonical => 1})