summaryrefslogtreecommitdiff
path: root/list-objects.h
diff options
context:
space:
mode:
authorCélestin Matte <celestin.matte@ensimag.fr>2013-06-14 13:50:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-14 16:02:18 (GMT)
commite83d36b66fc578d8aa965be15037bc1155f163cd (patch)
treef600285e61e5100ed05207702bd2a506d227f9d3 /list-objects.h
parent86e95ef2d4803c0fd2cac1afdd66c702ee2bafc1 (diff)
downloadgit-e83d36b66fc578d8aa965be15037bc1155f163cd.zip
git-e83d36b66fc578d8aa965be15037bc1155f163cd.tar.gz
git-e83d36b66fc578d8aa965be15037bc1155f163cd.tar.bz2
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: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'list-objects.h')
0 files changed, 0 insertions, 0 deletions