git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/4] t0021: fix filehandle usage on older perl

From
Lars Schneider <larsxschneider@gmail.com>
Date
Nov 6, 2016, 14:55 UTC
Message-ID
<36375B98-2706-4A07-96F7-75D89B5FFD60@gmail.com>
In-Reply-To
<20161102182301.hezruhtuhra6uoft@sigill.intra.peff.net>
Show 42 quoted lines
> On 02 Nov 2016, at 19:23, Jeff King <peff@peff.net> wrote:
> 
> 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>
> ---
> I see J6t solved this a week ago using "FileHandle". These days that is
> basically a compatibility synonym for IO::File. I think both should be
> available pretty much everywhere, so I went with IO::File for the
> reasons above. But if that doesn't work for some reason, switching to
> "use FileHandle" should be OK, too.
> 
> I don't have an old enough perl easily available to test it either way.
> 
> t/t0021/rot13-filter.pl | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
> index e3ea58e1e..4d5697ee5 100644
> --- a/t/t0021/rot13-filter.pl
> +++ b/t/t0021/rot13-filter.pl
> @@ -21,6 +21,7 @@
> 
> use strict;
> use warnings;
> +use IO::File;
> 
> my $MAX_PACKET_CONTENT_SIZE = 65516;
> my @capabilities            = @ARGV;
> -- 
> 2.11.0.rc0.258.gf434c15
Looks good to me (and works flawlessly on newer macOS).

Thanks, Lars

Previous: Torsten BögershausenNext: Johannes Sixt
Message 23 of 30 in “What's cooking in git.git (Oct 2016, #09; Mon, 31)”
  1. Junio C HamanoOct 31, 2016
  2. Torsten BögershausenNov 2, 2016
  3. Junio C HamanoNov 2, 2016
  4. Johannes SchindelinNov 2, 2016
  5. Junio C HamanoNov 2, 2016
  6. Torsten BögershausenNov 2, 2016
  7. Jeff KingNov 2, 2016
  8. 0/4 t0021 perl portability fixupsJeff King, Nov 2, 2016
  9. 1/4 t0021: use write_script to create rot13 shell scriptJeff King, Nov 2, 2016
  10. Lars SchneiderNov 6, 2016
  11. Jeff KingNov 6, 2016
  12. Lars SchneiderNov 6, 2016
  13. 2/4 t0021: put $TEST_ROOT in $PATHJeff King, Nov 2, 2016
  14. Johannes SixtNov 3, 2016
  15. Jeff KingNov 3, 2016
  16. Johannes SixtNov 3, 2016
  17. Lars SchneiderNov 6, 2016
  18. 3/4 t0021: use $PERL_PATH for rot13-filter.plJeff King, Nov 2, 2016
  19. Lars SchneiderNov 6, 2016
  20. Jeff KingNov 6, 2016
  21. 4/4 t0021: fix filehandle usage on older perlJeff King, Nov 2, 2016
  22. Torsten BögershausenNov 2, 2016
  23. Lars SchneiderNov 6, 2016
  24. Johannes SixtNov 2, 2016
  25. Lars SchneiderNov 3, 2016
  26. Lars SchneiderNov 2, 2016
  27. Torsten BögershausenNov 5, 2016
  28. Karthik NayakNov 8, 2016
  29. Torsten BögershausenNov 5, 2016
  30. Karthik NayakNov 8, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.