Being new to Perl, I did not have the luxury of taking the time to learn it thoroughly (i.e the OO part) before I began working on my project.
However, what made me choose Perl over any other language, is that the complex data structures allowed me to link together a lot of data in very complex ways (and yes, the ways in which they are linked are truly complex due to the nature of the data itself).
It should be noted that this program in 'stand-alone'. It's input is a flat file with horrible amounts of intertwined data, it's output is some csv files, and an xml file. If it breaks, it will need to be fixed, but no other user/programmer will ever have to interact with it.
From this complex data, I constructed an xml file for my fellow workers to use, when they need to use the same information for other purposes.
When they need to cross-reference the data (is x in b under condition y?), their c-code is much more difficult to maintain than the similar perl structures.
With this knowledge, I have been singing the praises of Perl, for it allows me, simply, to manipulate data in ways that would otherwise most likely require a database.
To aid in maintainability, all of the relevant properties of each data structure was accessed via constants, given meaningful names (this is an arbitrary example, it's not really from my code)
use constant ADDRESS => 1 use constant POSTAL_CODE => 2 $persons{$name}[ADDRESS] = $addr; if (exists $areas{POSTAL_CODE}[ADDRESS]{$addr}) { ... do something...}
Could this have been done using OO?
Maybe.
Would it have been faster to code, and easier to maintain?
Probably not.
Remember, that not all solutions apply to all problems, and not all 'good rules' apply to all situations.
In reply to Re: multi-tier collections & lack of modulization/OO
by Sandy
in thread multi-tier collections & lack of modulization/OO
by pg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |