in reply to Re: Is a here-doc a good way to retrieve data file contents for testing?
in thread Is a here-doc a good way to retrieve data file contents for testing?

sub json_here { <<'END_JSON' =~ s/\n\z//r }

Although I'd probably have done something similar, I just wanted point out that s///r requires Perl 5.14+, which may be a limitation if this is a module that is intended to be compatible with a broad range of Perl versions. sub json_here { chomp( my $json = <<'END_JSON'); $json } works fine too.