summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-07 07:09:08 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-07 07:09:08 +0000
commitfac7034317257ca372dae1fbecbc49d69a7c7d66 (patch)
tree528ddf8527341f8c7ca22e356c2497ef74f4f329
parent3969a89698ec7136fcf0eb1062fdf63f0e7726f4 (diff)
downloadperl-fac7034317257ca372dae1fbecbc49d69a7c7d66.tar.gz
clarify behavior of vec() when arguments are off the end of the
string (from M J T Guy) p4raw-id: //depot/perl@5014
-rw-r--r--pod/perlfunc.pod10
1 files changed, 7 insertions, 3 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index c9efcd1231..88cbb0a6e5 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -5273,9 +5273,13 @@ to give the expression the correct precedence as in
vec($image, $max_x * $x + $y, 8) = 3;
-Vectors created with C<vec> can also be manipulated with the logical
-operators C<|>, C<&>, and C<^>, which will assume a bit vector
-operation is desired when both operands are strings.
+If the selected element is off the end of the string, the value 0 is
+returned. If an element off the end of the string is written to,
+Perl will first extend the string with sufficiently many zero bytes.
+
+Strings created with C<vec> can also be manipulated with the logical
+operators C<|>, C<&>, C<^>, and C<~>. These operators will assume a bit
+vector operation is desired when both operands are strings.
See L<perlop/"Bitwise String Operators">.
The following code will build up an ASCII string saying C<'PerlPerlPerl'>.