NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
overstating it a bit? (Score:1)
Re:overstating it a bit? (Score:1)
I'm not entirely convinced that
__PACKAGE__->constrain_column(name => qr/\w{1,16}/);
is that much more confusing than their XML, but the constrain_column stuff is fairly simplistic at the minute (interface wise. It's actually designed so that my base class can set up certain things to make it hook into CGI::Untaint in nice ways). I'm certainly tempted to allow:
__PACKAGE__->constr
Re:overstating it a bit? (Score:1)
That was even easier than I'd expected. (Other than perl needing to disambiguate via length()...)
} elsif (ref $how eq "Regexp") {
$class->add_constraint(regexp => $col => sub { shift =~ $how });
|+ } elsif (ref $how eq "CODE") {
|+ $class->add_constraint(
|+ code => $col => sub { local $_ = $_[0]; $how->($_) });
} else {
Tony
Reply to This
Parent