Test::S...adAJSON(3)

πŸ“¦
version 1.84 Β· 2 versions
, in fedora 43

✨ Test::Smoke::Util::LoadAJSON(3) ✨

okay bestie, so this is the manual page for Test::Smoke::Util::LoadAJSON and honestly? it's short, it's sweet, it's giving "little utility that carries the whole squad" πŸ’…


🌸 NAME 🌸

Test::Smoke::Util::LoadAJSON β€” a Cpanel::JSON::XS / JSON:PP / JSON::XS Factory Class 🏭


πŸŽ€ SYNOPSIS πŸŽ€

use Test::Smoke::Util::LoadAJSON;
my $json = Test::Smoke::Util::LoadAJSON->new->utf8->pretty->encode(\%data);

literally one line of setup and you're off, no cap ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so like. this is purely a fallback factory class that helps keep our code clean. that's the whole assignment, and it ate. πŸ‘‘

it exists for the girlies with a clean perl 5.14+ install who have JSON::PP but not JSON. also for people who installed JSON::XS on a pre-5.14 system. we see you, we got you. 🫢

it also checks for $ENV{PERL_JSON_BACKEND} to force either of the two. so if you wanna be bossy about which backend shows up, that's the vibe check you need to pass. 😌


🧚 my $class = Test::Smoke::Util::LoadAJSON->find_base_class()

on success, returns one of: Cpanel::JSON::XS, JSON::PP, JSON::XS ✨

returns undef on failure. (yes, the void, the nothing, the ghosting 😭)


πŸ’œ JSON

returns the current $json_base_class. that's it. that's the whole thing. iconic. πŸ’…


🌈 my $obj = Test::Smoke::Util::LoadAJSON->new(<arguments>)

if a base class is found, it will return an instantiated object. slay. πŸŽ‰

⚠️ heads up though β€” this will die() if no base class could be found. like, full-on dramatic exit. no object for you, bestie. πŸ’€

Β© MMXIV-MMXXIII, All rights reserved.

  • Abe Timmerman <abeltje@cpan.org>

this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. fr fr, go wild (respectfully). 🌸

see:

this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. so like, it's giving hope and vibes, not legal guarantees. πŸ™ˆ


and that's the whole page, bestie πŸ’– this one's from perl v5.42.0, dated 2025-07-25 β€” mwah, go forth and JSON responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from