diff options
author | James E Keenan <jkeenan@cpan.org> | 2016-02-12 20:36:25 -0500 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-08-06 14:00:34 -0600 |
commit | b94222d1cf630489ad232d328d4a8c81d3f98d48 (patch) | |
tree | 4823b8b704bda6cfddcde945d20c5b8e34d3bcfc /pod/perlfunc.pod | |
parent | 877dac956031909a696ab7d4ba3a4665bb841dec (diff) | |
download | perl-b94222d1cf630489ad232d328d4a8c81d3f98d48.tar.gz |
Document that return value of pos(), by default, expresses characters.
When 'use bytes' is in effect, the return value expresses bytes.
Revise documentation and add some tests exemplifying this.
On recommendation of Jason Gibson.
For: RT # 127518
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r-- | pod/perlfunc.pod | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 2ac48b9196..176b02cc7d 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -5604,7 +5604,9 @@ X<pos> X<match, position> Returns the offset of where the last C<m//g> search left off for the variable in question (L<C<$_>|perlvar/$_> is used when the variable is not -specified). Note that 0 is a valid match offset. +specified). This offset is in characters unless the +(no-longer-recommended) L<C<use bytes>|bytes> pragma is in effect, in +which case the offset is in bytes. Note that 0 is a valid match offset. L<C<undef>|/undef EXPR> indicates that the search position is reset (usually due to match failure, but can also be because no match has yet been run on the scalar). |