Hi ,
The oracle environment variables ,open and write in a separate file and do this
require "./oraenv.pl";
in your present pl ,the oraenv.pl be the file where you set the environment variables instead of in BEGIN and then compile the code and you should get the environment variables recognized correctly