From: Eric Sunshine Date: Sat, 08 Jun 2013 00:42:35 GMT Subject: Re: [PATCH v2 17/22] git-remote-mediawiki: Brace file handles for print for more clarity Message-ID: In-Reply-To: <1370641344-4253-18-git-send-email-celestin.matte@ensimag.fr> On Fri, Jun 7, 2013 at 5:42 PM, Célestin Matte 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 > Signed-off-by: Matthieu Moy > > Conflicts: > > contrib/mw-to-git/git-remote-mediawiki.perl Uninteresting conflict information can be dropped.