in reply to database connection

This sound more of an issue running SQL scripts in sqlplus than perl issue. So I would expect the EXIT command to be fed into SQLPLUS if it is not in the mySql.sql script.
my $sqlsource = 'mySql.sql'; open( SQLPLUS, "|sqlplus /nolog") or die "Can't run sqlplus\n" ; print SQLPLUS <<SQL; connect USERNAME/PASS\@INST \@$sqlsource EXIT SQL close SQLPLUS;
Hope it helps
UnderMine