http://www.perlmonks.org?node_id=623684


in reply to Problem with program structure

my $EngWales_First_cat_observed; my $EngWales_First_cat_DSRs; my $EngWales_First_cat_Lower_95_Confidence_Limits; my $EngWales_First_cat_Upper_95_Confidence_Limits; my $EngWales_Second_cat_observed; my $EngWales_Second_cat_DSRs; my $EngWales_Second_cat_Lower_95_Confidence_Limits; my $EngWales_Second_cat_Upper_95_Confidence_Limits; my $EngWales_Third_cat_observed; my $EngWales_Third_cat_DSRs; my $EngWales_Third_cat_Lower_95_Confidence_Limits; my $EngWales_Third_cat_Upper_95_Confidence_Limits; my $PlaceX_First_cat_observed; my $PlaceX_First_cat_DSRs; my $PlaceX_First_cat_Lower_95_Confidence_Limits; my $PlaceX_First_cat_Upper_95_Confidence_Limits; my $PlaceX_Second_cat_observed; my $PlaceX_Second_cat_DSRs; my $PlaceX_Second_cat_Lower_95_Confidence_Limits; my $PlaceX_Second_cat_Upper_95_Confidence_Limits; my $PlaceX_Third_cat_observed; my $PlaceX_Third_cat_DSRs; my $PlaceX_Third_cat_Lower_95_Confidence_Limits; my $PlaceX_Third_cat_Upper_95_Confidence_Limits; my $Sex_specificity; my $Comparitor_file_statistic; my $Comparitor_file_age_group; my $Comparitor_file_period; my $Comparitor_file_scale;
the "first", "second", "third" in the code above is probably better expressed using arrays where the numbers 0, 1, and 2 give you the first, second, or third element.

overall, I think this program could benefit from an understanding of data structures, particular array and hash references. "Advanced Perl Programming" 2nd edition was great for this. 3rd edition by Cozens is a completely different animals. So, I recommend that you read perldsc and think hard about how it's contents could improve your program.


Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality