PsychoPunk's answer seems to be on point for your problem. The problem of (not) side-effecting the process environment by modifying %ENV has been discussed in a separate thread. See here for one answer.
My own particular solution about the $ENV{ODBCHOME} is to
have the script set it. It's the only %ENV setting I mess
with on runtime. My reason for doing this is my scripts can
use multiple DBMS and so I actually set $ENV{$DBTYPE} in
order to provide the DBD driver the environment that it will
need when I need it. Plus, setting the necessary environment
variables may come in handy when you don't know whether a
given user will have it set when they wish to run your code.
Especially in this case, you don't really need
$ENV{ODBCHOME} hanging around when you're not running the
script since any system tools such as odbctest (a tool that
comes with the Openlink driver) already have it built in.