From 57b18b44e1770b163aba55eacf53195a8305398e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 21 May 2016 05:27:06 +0000 Subject: localize $/ in more places to avoid potential problems This hopefully makes the intent of the code clearer, too. The the HTTP use of the numeric reference for getline caused problems in Git.pm, already. --- t/httpd-corner.psgi | 2 ++ t/httpd-unix.t | 1 + 2 files changed, 3 insertions(+) (limited to 't') diff --git a/t/httpd-corner.psgi b/t/httpd-corner.psgi index 2f7be832..222b9e01 100644 --- a/t/httpd-corner.psgi +++ b/t/httpd-corner.psgi @@ -30,6 +30,7 @@ my $app = sub { return sub { open my $f, '<', $fifo or die "open $fifo: $!\n"; + local $/ = "\n"; my @r = <$f>; $_[0]->([200, $h, \@r ]); }; @@ -38,6 +39,7 @@ my $app = sub { my $fh = $_[0]->([200, $h]); open my $f, '<', $fifo or die "open $fifo: $!\n"; + local $/ = "\n"; while (defined(my $l = <$f>)) { $fh->write($l); } diff --git a/t/httpd-unix.t b/t/httpd-unix.t index 00adf13c..16f7bdd2 100644 --- a/t/httpd-unix.t +++ b/t/httpd-unix.t @@ -103,6 +103,7 @@ SKIP: { ok(-f "$tmpdir/pid", 'pid file written'); open my $fh, '<', "$tmpdir/pid" or die "open failed: $!"; + local $/ = "\n"; my $rpid = <$fh>; chomp $rpid; like($rpid, qr/\A\d+\z/s, 'pid file looks like a pid'); -- cgit v1.2.3-24-ge0c7