GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Test2::Harness::Util::JSON(3) User Contributed Perl Documentation Test2::Harness::Util::JSON(3)

Test2::Harness::Util::JSON - Utility class to help Test2::Harness pick the best JSON implementation.

This package provides functions for encoding/decoding json, and uses the best json tools available.

    use Test2::Harness::Util::JSON qw/encode_json decode_json/;

    my $data = { foo => 1 };
    my $json = encode_json($data);
    my $copy = decode_json($json);

$package = JSON()
This returns the JSON package being used by yath.
$bool = JSON_IS_PP()
True if yath is using JSON::PP.
$bool = JSON_IS_XS()
True if yath is using JSON::XS.
$bool = JSON_IS_CPANEL()
True if yath is using Cpanel::JSON::XS.
$bool = JSON_IS_CPANEL_OR_XS()
True if either JSON::XS or Cpanel::JSON::XS are being used.
$string = encode_json($data)
Encode data into json. String will be 1-line.
$data = decode_json($string)
Decode json data from the string.
$string = encode_pretty_json($data)
Encode into human-friendly json.
$string = encode_canon_json($data)
Encode into canon-json.

The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.

Chad Granum <exodist@cpan.org>

Chad Granum <exodist@cpan.org>

Copyright 2020 Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://dev.perl.org/licenses/

2022-03-23 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.