Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Is there a way to make a JSON out of multiple records from MySQL?

by choroba (Cardinal)
on May 11, 2022 at 12:55 UTC ( [id://11143793]=note: print w/replies, xml ) Need Help??


in reply to Re: Is there a way to make a JSON out of multiple records from MySQL?
in thread Is there a way to make a JSON out of multiple records from MySQL?

> my $typehint_persons = [ ($typehint_person) x @rawRecords ];

For arrays of the same type, there's a function where you don't need to know the number:

my $typehint_persons = json_type_arrayof($typehint_person);

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11143793]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-16 15:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found