in reply to Re^2: Environment variable
in thread Environment variable

I believe the simplest method would be to put the defaults in an array and the ENV-vars as well, then you could use grep or array::compare or something like that to find out differences, like
my @defaults = (b1,..,b10);
my @envs = (a1,..,a10);
print "errors" if grep { $envs[$_] !~ $defaults[$_] } 0..9; this is untested and maybe not the most elegant, but I must confess I have not entirely understood your problem...
Hope it helps...

Replies are listed 'Best First'.
Re^4: Environment variable
by Anonymous Monk on Mar 12, 2010 at 16:05 UTC

    The hash methods are simpler, since they link the two lists implicitly.
    Loop over the keys, and if the value doesn't match the environment variable, then it is wrong.

    And no chance of your keys and values getting out of synch when you want to add one!