in reply to Turning a datafile into a data structure
Important things to remember are things like error_handling. i.e. in your example
or if you have items in items. then you must handle which end belongs to which begin!if (!/end_item/) { if(/begin_item/) { while (!/end_item/) { ...deal with data members here... } } } else { ... print or die an error message here about an end_item without b +egin ... }
Some of these things that one must think of you get for "free" using the module that davorg suggested...
|
|---|