Database Reference
In-Depth Information
of Perl including DBI and DBD::Oracle. After all, these components are built with Perl DBI. So
you can actually get away with simplifying the environment variable PERL5LIB as follows:
set PERL5LIB=<ORACLE_HOME>\sysman\admin\scripts
Remember though, to use the actual path of your ORACLE_HOME when adjusting the setting
in the user or system environment variables via the Control Panel . %ORACLE_HOME% is not expanded
when the variable is read from there.
Let's repeat the test we previously performed on UNIX, to verify that the settings are correct.
C:> set ORACLE_HOME
ORACLE_HOME=C:\oracle\product\db10.2
C:> set PATH
Path=C:\oracle\product\db10.2\perl\5.8.3\bin\MSWin32-x86-multi- thread;C:\oracle\pro
duct\db10.2\bin;C:\WINDOWS\System32
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
C:> set PERL5LIB
PERL5LIB=C:\oracle\product\db10.2\sysman\admin\scripts
C:> perl perl-dbi-test.pl
Username:
ndebes
Password:
secret
Net Service Name (optional, if ORACLE instance runs locally and ORACLE_SID is set):
TEN.oradbpro.com
Trying to connect to ndebes/ secret@TEN.oradbpro.com
Connected as user NDEBES
Transparently Running Perl Programs
on UNIX Systems
Perl scripts can always be run by entering the name of the Perl interpreter (simply perl ) and
passing the name of the Perl script to run as an argument as follows:
$ cat args.pl
print "Script name: $0\n";
$ perl args.pl
Script name: args.pl
When a UNIX text file is made executable with chmod +x filename and executed with
./ filename , a default shell for the UNIX system used is spawned and filename is passed as an
argument to it. The default shell for Linux is bash (Bourne Again Shell), while sh (Bourne Shell)
is the default command shell for most other systems. The pseudo comment #! executable on
the first line of a text file may be used to specify another program than the default shell for
processing a text file. At first glance, it may be appropriate to put the absolute path name of the
Perl interpreter after the pseudo comment ( #! ).
 
Search WWH ::




Custom Search