Hi all,

I need to convert a lot of UNIX scripts into Perl. Most of them uses the
UNIX's EOF/EOL functionality. These scripts are mostly used to connect to
Oracle databases. At the moment, installing a DBI is not an option. The
scripts will be running locally on the servers so technically it should be
able to connect to the database without using a password.

Example of a very simple test script is as below. If I run the script on
UNIX, it is all good. But on Windows, it gives the error "<< was unexpected
at this time." Can anyone please advise what I needed to change to get both
running for UNIX and Windows?

Thanks in advance.

Sample test code below:


sub test_01()
{
   print "+-------------------------------------+ \n";
   print "Running :: sub test-01 !!! \n";
   print "+-------------------------------------+ \n";

   print << `EOL`;
   sqlplus -S "/as sysdba" <<SQLEND
         set pagesize 0
         set heading off
         set feedback off
         set echo off

         alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS'
         ;

         select 'Today is : ' || sysdate || ' on Database -> ' || name
         from v\\\$database
         ;
SQLEND
EOL
}

########
# MAIN #
########

test_01;

exit 0;

###########
# THE END #
###########

Reply via email to