What are good alternatives to YAML handling (YAML::XS), and how do they compare?

An overview of alternatives to YAML handling in Perl, specifically focusing on how they compare to YAML::XS.
alternatives, YAML, Perl, YAML::XS, data serialization, JSON, TOML, XML, data interchange formats

# Example: Using JSON::MaybeXS as an alternative to YAML::XS

use strict;
use warnings;
use JSON::MaybeXS;

# Data structure
my $data = {
    name => 'John Doe',
    age => 30,
    skills => ['Perl', 'Python', 'JavaScript'],
};

# Convert Perl data structure to JSON
my $json_string = encode_json($data);
print "JSON representation: $json_string\n";

# Convert JSON back to Perl data structure
my $decoded_data = decode_json($json_string);
print "Decoded Perl structure: ", $decoded_data->{name}, "\n";
    

alternatives YAML Perl YAML::XS data serialization JSON TOML XML data interchange formats