As part of coding quality control we set up a constants file for record references shared between modules (and developers). So the above is rendered$r->{thisid} = 10; $r->{this_id} = 10;
Incorrect field indexes entered by bleary eyed developers in such asuse constant ID =>'thisid'; . . $r->{(ID)} = 10; . .
Will be immediately picked up by the compiler in development and not in production. ..... However This constants file in near 400 lines long and growing. Do the monks have any opinion on whether this was a reasonable strategy or is there a better way to ensure the same level of development robustness? Benno UPDATE - what I actually did Firstly I reread the perl documentation on exporting. Then I split the constants file into logical modules. In my case these were XML tokens, default setting and system tokens. Then I went through each module and changed the blanket includes to be more specific. Since there were 70 modules I wrote some helper scripts to find where the constants were being used and the automatic generation of the header include from within VI using the .!sh command. If anyone wants these I'll post later.$r->{(THISID)}
In reply to Advice on Global Constants by benno
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |