From: Simon McVittie Date: Mon, 1 Sep 2014 07:40:54 +0000 (+0100) Subject: use readfile() instead of reinventing it X-Git-Tag: 3.20140916~41^2 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/d55d06ea886bf9f212e6d83301800b1176cee60d use readfile() instead of reinventing it This avoids potential action-at-a-distance from locally redefining $/ but never reaching the end of the redefinition's scope. --- diff --git a/t/img.t b/t/img.t index 088a98328..9a48cb1c5 100755 --- a/t/img.t +++ b/t/img.t @@ -52,10 +52,7 @@ sub size($) { } my $outpath = "t/tmp/out/imgconversions"; -open (my $outhtmlfd, "<", "$outpath.html"); -local $/=undef; -my $outhtml = <$outhtmlfd>; -close $outhtmlfd; +my $outhtml = readfile("$outpath.html"); is(size("$outpath/10x-redsquare.png"), "10x10"); ok(! -e "$outpath/30x-redsquare.png");