From some very limited experiments, this is a very simple and effective way to control the types and values of variables in Perl.
This is a good way to enforce types or to catch errors in debugging. Though I'm unsure about using it in production code, especially since attributes are (were?) a moving target and subject to change.
A *major downside* is that assignment to variables is seriously slowed down, due to the fact that they become tied to a function that restricts their type. So don't use it for any time-sensitive code.
And of course it seems to increase a variable's size.
1 out of 1 found this review helpful. Was this review helpful to you? Yes No
1 hidden unhelpful review