No offense, but you don't seem to have a concept of databases in general or perl in particular. And with over 600k size file, I recommend that you not fool around with your database or field definitions. At least until you learn alot more.
Here is a record in links.db
Note that each field is separated by a vertical bar
|.
In links.db these fields are defined
Code:
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 80, 125, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '100x5', 500, 1, '', ''],
ContactName => [6, 'alpha', 40, 75, 1, '', ''],
ContactEmail => [7, 'alpha', 40, 75, 1, '',
'.+@.+\..+'],
Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
Each field has certain attributes separated by commas. Search for "Field Definitions" to learn what each attribute is. Notice that each has an attribute of alpha or numer. This means that the field is either text or numeric - If it is numeric, you can't enter text into the field and if it is alpha, you cannot use it in arithmetic operations (but you can enter numbers).
If you want to delete the ContactEmail field you have to do lots of things.
Code:
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 80, 125, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '100x5', 500, 1, '', ''],
ContactName => [6, 'alpha', 40, 75, 1, '', ''],
ContactEmail => [7, 'alpha', 40, 75, 1, '',
'.+@.+\..+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
Notice field 8 has been delete.
Then you must delete that information in EVERY record.
becomes
Now just find all the other places where ContactEmail exist, and delete not just the variable itself but the appropriate code as well ( and determining what is appropriate code to delete requires at least some knowledge of programming and perl ).
If you forget to delete the information correctly, you will see strange results.
Check out
http://home.hccnet.nl/...e/t2t/text2table.htm Remember to back up in case you screw up!!!!!!!!!!!!!!!!!!!!!!!!!!!
Gene "The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."