in reply to use oracle home in script
You are setting Perl-variables, not environment variables. So as a quick remedy, you could set
and so on. See perlvar (%ENV).$ENV{ORACLE_HOME}="/u01/app/oracle/product/10.2.0.4"; ...
Long term approach would be to start using DBI and DBD::Oracle. There are also some PM tutorials: Database Programming available.
In Section
Seekers of Perl Wisdom