--------- Start My Code open SQLP, "|sqlplus -s /nolog >> $output_file_name " or die "cannot open sqlplus $ERRNO \n"; # Connect and execute the script. This is done by writing to the stream we open for sqlplus. SQLP "connect $user_name/$password \n" or die "cannot write in doScript"; print SQLP "\@$script_name; \n" or die "cannot write in doScript"; close SQLP or die "cannot close in doScript"; print "Status is :" . ($? >> 8); --------- End My Code