Gossamer Forum
Home : General : Perl Programming :

Perl object that reads XML encoded data from a database

Quote Reply
Perl object that reads XML encoded data from a database
Hi i was wondering if you could help me implement a Perl object that reads XML encoded data
from a database.The object must make connection to a database using a DSN supplied to its
constructor. The program must use DBD::CSV, with the files stored in a local directory.

The database must be able to maintain a shopping basket and must store the following data:
1) Login username
2) Item_id (some product id)
3) Number of items in cart (e.g. if a person is buying 1, 2, or more of the same item)
4) Time_item added
Finally i need help writing a Perl object which can access the data in this table, with
methods being:
new_cart( user_name )
add_item( user_name, item_id, number )
remove_item( user_name, item_id )
clear_cart( user_name )
It would be much appreciated if you would give me some sort of idea of how to go about
achieving this.
Many thanks!