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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 7, 2013 at 5:42 PM, Célestin Matte
<celestin.matte@xxxxxxxxxx> 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 <celestin.matte@xxxxxxxxxx>
> Signed-off-by: Matthieu Moy <matthieu.moy@xxxxxxxxxxxxxxx>
>
> Conflicts:
>
>         contrib/mw-to-git/git-remote-mediawiki.perl

Uninteresting conflict information can be dropped.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]