summaryrefslogtreecommitdiff
path: root/dist/Data-Dumper
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2018-04-21 16:41:45 +0200
committerAaron Crane <arc@cpan.org>2018-07-22 13:30:33 +0100
commit83148b3e4bc0e108aedd9420c2c9847b65bd7a3f (patch)
treed083dc07b79243c56032fccd45f6968fc7c9405c /dist/Data-Dumper
parent3f0ff2a3a89e6b940bcf9f559b611c4a8795f5ce (diff)
downloadperl-83148b3e4bc0e108aedd9420c2c9847b65bd7a3f.tar.gz
dist/Data-Dumper/t/indent.t: avoid scalar split
Older versions of Perl yield a warning for this usage.
Diffstat (limited to 'dist/Data-Dumper')
-rw-r--r--dist/Data-Dumper/t/indent.t5
1 files changed, 3 insertions, 2 deletions
diff --git a/dist/Data-Dumper/t/indent.t b/dist/Data-Dumper/t/indent.t
index 2814f0b215..2c9d8f967c 100644
--- a/dist/Data-Dumper/t/indent.t
+++ b/dist/Data-Dumper/t/indent.t
@@ -91,10 +91,11 @@ like($dumpstr{ar_indent_3},
qr/\#0.+'foo'.+\#1.+42/s,
"Indent(3) annotates array elements with their indices"
);
+sub count_newlines { scalar $_[0] =~ tr/\n// }
{
no if $] < 5.011, warnings => 'deprecated';
- is(scalar(split("\n" => $dumpstr{ar_indent_2})) + 2,
- scalar(split("\n" => $dumpstr{ar_indent_3})),
+ is(count_newlines($dumpstr{ar_indent_2}) + 2,
+ count_newlines($dumpstr{ar_indent_3}),
"Indent(3) runs 2 lines longer than Indent(2)");
}