Skip Menu |

This queue is for tickets about the Attribute-Property CPAN distribution.

Report information
The Basics
Id: 3800
Status: rejected
Priority: 0/
Queue: Attribute-Property

People
Owner: Nobody in particular
Requestors: metaperl [...] urth.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: creating a ream of non-validated properties
I am creating a large number of object slots which do not require validation. It would be nice if A::P had an API call like this: 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); } Methods qw( @unvalidated );
Date: Wed, 17 Sep 2003 01:10:41 +0200
From: Juerd <juerd [...] convolution.nl>
To: via RT <bug-Attribute-Property [...] rt.cpan.org>
Subject: Re: [cpan #3800] creating a ream of non-validated properties
RT-Send-Cc:
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