Thread (36 messages) flat view 36 messages, 5 authors, 2016-06-15

Re: [PATCH v2 17/22] git-remote-mediawiki: Brace file handles for print for more clarity

From: Eric Sunshine <hidden>
Date: 2016-06-15 22:57:36

On Fri, Jun 7, 2013 at 5:42 PM, Célestin Matte
[off-list ref] wrote:
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: Célestin Matte <redacted>
Signed-off-by: Matthieu Moy <redacted>

Conflicts:

        contrib/mw-to-git/git-remote-mediawiki.perl
Uninteresting conflict information can be dropped.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help