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.
In reply to Re^2: Is a here-doc a good way to retrieve data file contents for testing?
by haukex
in thread Is a here-doc a good way to retrieve data file contents for testing?
by Lotus1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |