Q:

can i fix a component version to a product release in perl

My problem is as follows: 
I have a system which consists of several components.
Each release consists of versions for the components. Basically indicating to the end user that he has to set a list of environment variables to have comptabile and stable version of components.
This needs user to specifically set all the components versions which is a pain as sometimes he might miss few as we have a huge list.
The current solution i have is a very brute force algo where i check what version of a single component and setting the other environment variables for all other components. This needs user to set just one environment variable.
But the problem with this approach going forward would be a bunch of ifels in perl in my code which would only increase.
   if (defined $ENV{VARIABLE_NAME}) {
      my $x = $ENV{$VARIABLE_NAME} ;
      if ( $x =~ /version/){
      $ENV{VAR1} = "a";
      $ENV{VAR2} = "b";
  } elsif (){} elsif(){}

}
Is there a better approach...any inputs would be helpful.

A:

Put the environment variabales into a hash for every release.
Make a list of these hashes for all releases.
Then go through the list of hashes, look for the environment variables, if you find one, set the other ones. You're done. If not, go through the rest of the hash. If you didn't find anything, go to the next has in the list and repeat.
Recommended reading: "perldoc perldata"
I hope that's enough to get your started.

