#!/usr/bin/perl use strict; use warnings; use Test::More tests => 1; print "-------\n"; print json_q(); print "-------\n"; print json_here(); print "-------\n"; is(json_q(), json_here(), "should be the same"); sub json_q { q( "Type": 0, "Width": 504, "X": 18, "Y": 18 } ] }); } sub json_here { <<'END_JSON' =~ s/\n\z//r } "Type": 0, "Width": 504, "X": 18, "Y": 18 } ] } END_JSON