##### Generating log file--- my $logfile = "${basePath}/VoucherStateChange.$filedate.log"; open (STDOUT, ">>", "$logfile") or die "Can't open logfile $logfile for writing: $!\n"; open (STDERR, ">>", "$logfile") or die "Can't open logfile $logfile for writing: $!\n"; print "$logfile\n"; my $SQLPLUS='/opt/oracle/product/11g/db_1/bin/sqlplus -S system/coolman7@vsdb'; `$SQLPLUS \@${basePath}/VoucherQuery1.sql $startdate> ${basePath}/QueryResult1.txt`;