via RT skribis 2003-09-16 14:23 (-0400):
Show quoted text> BEGIN {
> my @unvalidated = qw(a b c d e f g h i j k l m n o p q r s t u v w x y z);
> }
@unvalidated doesn't exist outside of the BEGIN block. See MJD's Coping
with Scoping.
Show quoted text> Methods qw(
> @unvalidated
> );
As usual, you suggest something that Perl can already do. I'm not going
to re-invent this wheel.
BEGIN { eval join ';', map "sub $_ : Property", 'a' .. 'z' }
I think having 26 public properties is a sign of bad design. An object
should be a black box. If you need to do something with private data,
consider putting that functionality in the class. Don't communicate too
much with the outside world :)
Please note that Attribute::Property does not create new subs. It just
replaces existing ones. A::P is not and will not be a MethodMaker.
Regards,
Juerd