lvalueUse lvalue subroutines with ease | |
Download |
lvalue Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Mons Anderson
- Publisher web site:
- http://search.cpan.org/~mons/
lvalue Tags
lvalue Description
Use lvalue subroutines with ease lvalue is a Perl module to use lvalue subroutines with ease.SYNOPSISSimply put get and set blocks at the end of your lvalue sub. Please note, no comma or semicolon between statements are allowed (in case of semicolon only last statement will be take an action) use lvalue; sub mysub : lvalue { get { return 'result for get'; } set { my $set_value = shift; # ... } } mysub() = 'test'; # will invoke set block with argument 'test'; print mysub(); # will invoke get block without arguments. result will be returned to print; sub readonly : lvalue { get { return 'readonly value'; } } print readonly(); # ok readonly = 'test'; # fails sub writeonly : lvalue { set { my $set_value = shift; # ... } } writeonly = 'test'; # ok print writeonly(); # fails Requirements: · Perl
lvalue Related Software