Re: [PATCH 8/9] gitweb: Convert output to using indirect file handle
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 16, 2010, 01:41 UTC
- Message-ID
- <7v8wbyn7vy.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <201001160214.58167.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 6 quoted lines
> 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)...