develooper Front page | perl.perl5.porters | Postings from February 2000

[PATCH] Document vec() off end of string

From:
M.J.T. Guy
Date:
February 5, 2000 08:10
Subject:
[PATCH] Document vec() off end of string
Message ID:
E12H7n4-0005jC-00@ursa.cus.cam.ac.uk
Since there are programs around which exploit this, it probably ought to
documented.

Patch is for 5.005_63.


Mike Guy


--- ./pod/perlfunc.pod.orig	Fri Jan 28 18:32:25 2000
+++ ./pod/perlfunc.pod	Sat Feb  5 16:06:37 2000
@@ -5167,6 +5167,10 @@
 
     vec($image, $max_x * $x + $y, 8) = 3;
 
+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.
+
 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.

End of patch



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About