Re: [PATCH 8/9] gitweb: Convert output to using indirect file handle

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 8/9] gitweb: Convert output to using indirect file handle

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:02

Jakub Narebski [off-list ref] writes:
This means replacing

  print <something>;
by
  print {$out} <something>;
Just out of curiosity, how is this different from

    print $out <something>;

Re: [PATCH 8/9] gitweb: Convert output to using indirect file handle

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:48:02

On Sat, 16 Jan 2010, Junio C Hamano wrote:
Jakub Narebski [off-list ref] writes:
quoted
This means replacing

  print <something>;
by
  print {$out} <something>;
Just out of curiosity, how is this different from

    print $out <something>;
Actually there is no difference.  It doesn't matter one way or other in
situations in gitweb.

I have thought however (but I might be mistaken) that "print {$fh} <sth>"
is idiomatic Perl.

'perldoc -f print' says:
    Note that if you're storing FILEHANDLES in an array or other expression,
    you will have to use a block returning its value instead:

           print { $files[$i] } "stuff\n";
           print { $OK ? STDOUT : STDERR } "stuff\n";

Also, there is no "," between FILEHANDLE and LIST in "print FILEHANDLE LIST"
-- 
Jakub Narebski
Poland
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help