in reply to Re: "Hash Matrix" Design Question
in thread "Hash Matrix" Design Question

If this data structure is big, you might put it into a config file

This is not possible, because it needs to be computed at run time...

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^3: "Hash Matrix" Design Question
by jethro (Monsignor) on Sep 24, 2008 at 14:00 UTC

    Then your conf idea sounds good.

    A different idea might be to have three subs like this:

    my @alloptions=(); my @allOS=(); sub add_OS { # add an operation system to the configuration matrix my $os= shift; push @allOS, $os; foreach my $opt (@alloptions) { calculate_parameter($os,$opt); } } sub add_option { # add a configuration option to the configuration matrix my $option= shift; push @alloptions, $option; foreach my $os (@allOS) { calculate_parameter($os,$option); } } sub calculate_parameter { # calculate the option parameter in a specific OS my ($os, $option)= @_; ...

    Creating and filling the matrix is automatically done by calling add_OS and add_option for every os and option.