Thread (1 message) 1 message, 1 author, 2016-06-15

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:
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:
Note that "in an array or other expression".  I've always thought the
intention of this phrase was "you _could_ help the parser by doing this,
if you have expression more complex than a simple scalar variable
reference".

IOW, I know that {} _can_ be used there, but I haven't seen people write
{$a_single_variable}, especially without a space around the "expression"
(technically, a single variable is an expression), when

	print $fh <stuff>

suffices, and I was curious why you chose to use the syntax when it wasn't
necessary.  Besides, {$fh} looks so eh... (hesitates to mention a dirty
word ^W^W^Wthe name of a different language, but bleeps it out)...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help