Hi all, I have a problem where I have say, five tables one of which is called "log" this keeps a log of various updates that are done to the other four tables.

I have been working on one particular script and I have a function called "add_to_log" which adds various information about the update of one table to the log table. However I've been told that this will need to be rolled out across other tables.

What would be a good way to write a generic function that would be able to handle updates for various tables given that there willl be different numbers of columns and they will all be named something different.

I would like to write a class to handle this but I'm not much of an OO programmer at the moment. The updates are being done to "events" tables so perhaps I could have an event class, something like this perhaps:

my $transaction_valid = event->new;
$transaction_valid->log;


my $refund = event->new;
$refund->log;


if this was the case the "transaction_valid" and "refund" tables would be structured completely different so I'm struggling to see how I would design an appropriate class.

I'm only using transaction_valid and refund as an example as its more descriptive than what I've got to work with.


Can anyone help me out with this?


Cheers,

Graeme :)



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to