提交 e83d36b6 编写于 作者: C Célestin Matte 提交者: Junio C Hamano

git-remote-mediawiki: brace file handles for print for more clarity

This follows the following rule:
InputOutput::RequireBracedFileHandleWithPrint (Severity: 1)
    The `print' and `printf' functions have a unique syntax that supports an
    optional file handle argument. Conway suggests wrapping this argument in
    braces to make it visually stand out from the other arguments. When you
    put braces around any of the special package-level file handles like
    `STDOUT', `STDERR', and `DATA', you must the `'*'' sigil or else it
    won't compile under `use strict 'subs''.

      print $FH   "Mary had a little lamb\n";  #not ok
      print {$FH} "Mary had a little lamb\n";  #ok

      print   STDERR   $foo, $bar, $baz;  #not ok
      print  {STDERR}  $foo, $bar, $baz;  #won't compile under 'strict'
      print {*STDERR}  $foo, $bar, $baz;  #perfect!
Signed-off-by: NCélestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: NMatthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 86e95ef2
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册