in reply to read return value from a sql script using piped open

Maybe what you need to do is move the "exit" command for sqlplus out of the "$script_name" file and into a print statement:
... print SQLP "\@$script_name; \n" or die "cannot write in doScript"; # add: print SQLP "exit\n" or die "cannot write exit to sqlplus in doScript"; close SQLP or die "cannot close in doScript"; ... ****** Start t.sql select sysdate from dual / ****** end t.sql ...
Note: that's just something to try -- I don't have a clue whether it will work.

Is it the case that you have no hope of installing DBI and DBD::Oracle on the platforms involved? This would make it a lot easier to communicate with oracle through perl, without exposing account names/passwords.

One other point: are you sure you want to redirect sqlplus output to $output_file_name via the ">>" (append) operator? Do you intend to read that file back after a sequence of queries has been completed, or is it being read back after each query?