Title: 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[EMAIL PROTECTED] batch=yes";

     

        $compiledfile = "$sourcefilename\.fmx"; #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 $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[EMAIL PROTECTED] 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

Reply via email to