in reply to Foreach Complications
First of all I would strongly recommend cutting down on the globals. For an explanation of why see RE (tilly) 3: redeclaring variables with 'my'. After that, well I don't like having to keep multiple arrays in sync. It is too easy to get it wrong. Have you considered using anonymous hashes? An array of anonymous hashes with information about the title, sector, and the data is harder to make mistakes with. If you want you can even make them into objects and hide them off in some class.
If you try you can probably remove all need to ever think about what position in a particular data structure your data is. Push that accounting down to Perl and your program will be much more reliable, easier to write, and if that wasn't enough it will be easier to read as well. :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re (tilly) 1: Foreach Complications
by $code or die (Deacon) on Dec 07, 2000 at 20:56 UTC |