--- "Randal L. Schwartz" <merlyn@stonehenge.com> wrote:
>     sub insert {
>       die "cannot insert" unless our $READWRITE;
>       goto &{$_[0]->can("SUPER::insert")};
>     }
> 
>     sub update {
>       die "cannot update" unless our $READWRITE;
>       goto &{$_[0]->can("SUPER::update")};
>     }
> 
>     sub delete {
>       die "cannot delete" unless our $READWRITE;
>       goto &{$_[0]->can("SUPER::delete")};
>     }
> 
> I use "local our $READWRITE = 1" during some test harnesses when I
> set up a fake version of the database.
> 
> Apparently, everything else is built on these routines, so unless you
> call
> something even *lower* in your own code, this is enough to trap
> everything that RDBO is doing "out of the box".

Agreed and I have something very similar.  As noted in another
response, I just felt it would be good to trap this at the accessor
level to ensure that fatal errors would be reported where the bad code
is.

Cheers,
Ovid

--

Buy the book -- http://www.oreilly.com/catalog/perlhks/
Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to