>>>>> "Ovid" == Ovid <[EMAIL PROTECTED]> writes:
Ovid> The hack relies on the order of call stack frames being different when
Ovid> I'm constructing an object or just setting an accessor directly. How
Ovid> can I do this without relying on the internals like this?
It seems like everyone using RDBO reinvents the same things. Hooray
for this mailing list!
Here's what I did for my readonly class, based on discussions with jcs
six months ago:
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".
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object