The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use t::TestYAML ();
use JSON::Syck;
use Test::More tests => 1;

my $str = "foo\nbar\nbaz\n";
my $json = JSON::Syck::Dump({ str => $str });

unlike $json, qr/^  bar/m;