summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Chetlin <daniel@chetlin.com>2000-08-17 20:13:36 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-18 13:13:26 +0000
commit194e7b382bb28b53644a2ea16df2fe5fda9ad386 (patch)
tree40f57ef2f471618788fb5c050dd77b0cd719ca99
parent9fda99eb1f70da0c34e34102a2f16c904fd94c25 (diff)
downloadperl-194e7b382bb28b53644a2ea16df2fe5fda9ad386.tar.gz
perlfunc.pod -- clarifying sprintf array argument issues
Message-ID: <20000818031336.B14165@ilmd.chetlin.org> p4raw-id: //depot/perl@6695
-rw-r--r--pod/perlfunc.pod6
1 files changed, 6 insertions, 0 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index cef469fb32..fd724a1704 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -4414,6 +4414,12 @@ numbers, and even then only the standard modifiers are allowed). As a
result, any non-standard extensions in your local C<sprintf> are not
available from Perl.
+Unlike C<printf>, C<sprintf> does not do what you probably mean when you
+pass it an array as your first argument. The array is given scalar context,
+and instead of using the 0th element of the array as the format, Perl will
+use the count of elements in the array as the format, which is almost never
+useful.
+
Perl's C<sprintf> permits the following universally-known conversions:
%% a percent sign