t0021: fix filehandle usage on older perl
authorJeff King <peff@peff.net>
Wed, 2 Nov 2016 18:23:01 +0000 (14:23 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Nov 2016 02:36:29 +0000 (19:36 -0700)
The rot13-filter.pl script calls methods on implicitly
defined filehandles (STDOUT, and the result of an open()
call). Prior to perl 5.13, these methods are not
automatically loaded, and perl will complain with:

Can't locate object method "flush" via package "IO::Handle"

Let's explicitly load IO::File (which inherits from
IO::Handle). That's more than we need for just "flush", but
matches what perl has done since:

http://perl5.git.perl.org/perl.git/commit/15e6cdd91beb4cefae4b65e855d68cf64766965d

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0021/rot13-filter.pl
index e3ea58e1ed295e634bece1f3d9180ad20348b608..4d5697ee51c673abbe8a1a90b58bf5b7b9856ce1 100644 (file)
@@ -21,6 +21,7 @@
 
 use strict;
 use warnings;
+use IO::File;
 
 my $MAX_PACKET_CONTENT_SIZE = 65516;
 my @capabilities            = @ARGV;