Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Setting environment variable in Perl script
I need some help with a perl script! I have a script that currently
does batch compiles of forms and reports so I know it works. However, I
need to have a version of it for compiling forms in French using the
NLS_LANG=FRENCH_FRANCE.WE8ISO8859P1 parameter. Maybe it's not as simple
as I would like to think it is. After adding the variable, the perl
script returns a .BAD file without any other errors. Am I setting this
correctly? Here's a sample of the script that runs on Windows 2000.
#!F:\PERL\bin\perl -w
$ENV{NLS_LANG}="FRENCH_FRANCE.WE8ISO8859P1";
@filepatterns = ("*.fmb");
for $sourcefile (`dir/b @filepatterns`) {
@words = split(/\./, $sourcefile); #Get the filename and the extension in an array
$sourcefilename = $words[0]; #Assign the filename part to a variable
system "F:\\orant\\bin\\ifcmp60.exe module=F:\\NT_COMPILE\\$sourcefilename userid=txadm/pswd\@MTXTEST batch=yes";
$compiledfile = "$sourcefilename\.fmx"; #Derive the compiledfile name
#If the compiled file is there, then remove the error file
#and copy the compiled file to whereever it goes.
#else if the compiled file is not there, copy the source file to
#whatever.bad.
if (-s $compiledfile) { unlink "$sourcefilename.err"; system "copy $sourcefilename.fmb f:\\NT_MIGRATION\\TXTEST_FRENCH\\"; system "copy $sourcefilename.fmx f:\\NT_MIGRATION\\TXTEST_FRENCH\\"; unlink "$sourcefilename.fmx"; unlink "$sourcefilename.fmb"; } else { system "rename $sourcefilename.err $sourcefilename.err.bad"; system "rename $sourcefilename.fmb $sourcefilename.fmb.bad"; unlink "$sourcefilename.err"; unlink "$sourcefilename.fmb"; }
@filepatterns2 = ("*.rdf");
for $sourcefile2 (`dir/b @filepatterns2`) {
@words2 = split(/\./, $sourcefile2); #Get the filename and the extension in an array
$sourcefilename2 = $words2[0]; #Assign the filename part to a variable
system "F:\\orant\\bin\\rwcon60.exe userid=txadm/pswd\@MTXTEST stype=rdffile source=F:\\NT_COMPILE\\$sourcefilename2 dtype=repfile batch=yes";
$compiledfile2 = "$sourcefilename2\.rep"; #Derive the compiled file name
#If the compiled file is there, then remove the error file
#and copy the compiled file to whereever it goes.
#else if the compiled file is not there, copy the source file to
#whatever.bad.
if (-s $compiledfile2) { system "copy $sourcefilename2.rdf f:\\NT_MIGRATION\\TXTEST_FRENCH\\"; system "copy $sourcefilename2.rep f:\\NT_MIGRATION\\TXTEST_FRENCH\\"; unlink "$sourcefilename2.rep"; unlink "$sourcefilename2.rdf"; } else { system "rename reports.log $sourcefilename2.log.bad"; system "rename $sourcefilename2.rdf $sourcefilename2.rdf.bad"; unlink "reports.log"; unlink "$sourcefilename2.rdf"; }
Thanks in advance,
Carol
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Pena, Carol A INET: CAPena_at_tmw.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed Oct 22 2003 - 18:14:40 CDT
![]() |
![]() |