From 2ad09a1fe3da562638906ebab32a55108ba9c364 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 1 Aug 2012 20:12:47 -0700 Subject: [PATCH] perlfunc/printf: corrections, clarifications --- pod/perlfunc.pod | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index a60e9d5..408c915 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -5178,17 +5178,24 @@ X =for Pod::Functions output a formatted list to a filehandle Equivalent to C, except that C<$\> -(the output record separator) is not appended. The first argument of the -list will be interpreted as the C format. See +(the output record separator) is not appended. The FORMAT and the +LIST are actually parsed as a single list. The first argument +of the list will be interpreted as the C format. This +means that C will use C<$_[0]> as the format. See L for an -explanation of the format argument. If you omit the LIST, C<$_> is used; -to use FILEHANDLE without a LIST, you must use a real filehandle like -C, not an indirect one like C<$fh>. If C (including +explanation of the format argument. If C (including C) is in effect and POSIX::setlocale() has been called, the character used for the decimal separator in formatted floating-point numbers is affected by the LC_NUMERIC locale setting. See L and L. +For historical reasons, if you omit the list, C<$_> is used as the format; +to use FILEHANDLE without a list, you must use a real filehandle like +C, not an indirect one like C<$fh>. However, this will rarely do what +you want; if $_ contains formatting codes, they will be replaced with the +empty string and a warning will be emitted if warnings are enabled. Just +use C if you want to print the contents of $_. + Don't fall into the trap of using a C when a simple C would do. The C is more efficient and less error prone. -- 1.8.3.1