diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-09-05 22:07:18 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-09-05 22:07:18 +0000 |
commit | cd06dffe59d60ee6a2fdd7c81f8cef42c7026b36 (patch) | |
tree | bf5d5d4e9d1c11e7d63fd97ce74470e8bedc88d3 /ext/attrs | |
parent | a2126434f8dd8eabb11a2219137816815758ea93 (diff) | |
download | perl-cd06dffe59d60ee6a2fdd7c81f8cef42c7026b36.tar.gz |
initial implementation of lvalue subroutines (slightly fixed
version of patch suggested by Ilya Zakharevich, which in turn
is based on the one suggested by Tuomas J. Lukka <lukka@iki.fi>)
p4raw-id: //depot/perl@4081
Diffstat (limited to 'ext/attrs')
-rw-r--r-- | ext/attrs/attrs.pm | 5 | ||||
-rw-r--r-- | ext/attrs/attrs.xs | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/ext/attrs/attrs.pm b/ext/attrs/attrs.pm index fe2bf356e4..e97fa1ee39 100644 --- a/ext/attrs/attrs.pm +++ b/ext/attrs/attrs.pm @@ -46,6 +46,11 @@ execution. The semantics of the lock are exactly those of one explicitly taken with the C<lock> operator immediately after the subroutine is entered. +=item lvalue + +Setting this attribute enables the subroutine to be used in +lvalue context. See L<perlsub/"Lvalue subroutines">. + =back =cut diff --git a/ext/attrs/attrs.xs b/ext/attrs/attrs.xs index 53ba5354e2..a92922d497 100644 --- a/ext/attrs/attrs.xs +++ b/ext/attrs/attrs.xs @@ -10,6 +10,8 @@ get_flag(char *attr) return CVf_METHOD; else if (strnEQ(attr, "locked", 6)) return CVf_LOCKED; + else if (strnEQ(attr, "lvalue", 6)) + return CVf_LVALUE; else return 0; } |