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
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...