CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
transform a result set into JSON

 



zatlas1
User

Aug 15, 2017, 2:26 PM

Post #1 of 4 (2747 views)
transform a result set into JSON Can't Post

Is there a standard module to transform a result set into JSON.


If not could somebody please share some code that does it. We may then create (even a rudimentary) package as a starting point for the world to share and improve.

Thank you
ZA


Laurent_R
Veteran / Moderator

Aug 15, 2017, 11:18 PM

Post #2 of 4 (2743 views)
Re: [zatlas1] transform a result set into JSON [In reply to] Can't Post

Hi,

The standard CPAN JSON modules are this:
http://search.cpan.org/~ishigaki/JSON-2.94/lib/JSON.pm
and this:
http://search.cpan.org/~mlehmann/JSON-XS-3.03/XS.pm

(The second one is written partly in C and is usually more efficient. The first one acts as a simple wrapper around the second one when the second one is available.)

Check also this CPAN search for additional possibilities:
https://www.google.fr/search?q=cpan+json&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=bOGTWZ_hIKrHXqTzqLgN


ogit2
Novice

Aug 16, 2017, 1:10 AM

Post #3 of 4 (2741 views)
Re: [zatlas1] transform a result set into JSON [In reply to] Can't Post

Hi

See this post in the Beginner forum. It has the example you are after.

http://perlguru.com/gforum.cgi?post=84303;sb=post_latest_reply;so=ASC;forum_view=forum_view_collapsed;;page=unread#unread


zatlas1
User

Aug 16, 2017, 3:25 AM

Post #4 of 4 (2737 views)
Re: [ogit2] transform a result set into JSON [In reply to] Can't Post

Thank you all

There is also the DBIx class that I looked at, so there is no need for a new package. I will use one of these solutions

ZA

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives