mmittiga17 has asked for the wisdom of the Perl Monks concerning the following question:
Hi All, I am looking for suggestions or to be pointed in the right di +rection on using config files to process lines of perl code. I am fa +miliar with using config modules but I am looking to take it a step d +eeper. What I would like to do is have a perl script look to a conf +ig file in order to decide how to process a record in a text file. Example: I need to map a code from a record to another code. if Trancode0 eq ABC than make Trancode XYZ. Below is how I do it in t +he script but want to avoid having to keep changing the script every +time I need to create a new translation mapping.
Any thoughts or suggestion are deeply appreciated.if (($TRANCODE0 =~m/(TSP|KSP)/) && ($QUANTITY ne '00000000.00000') && +($QSIGN eq "+") && ($KEYCODE =~m/(10|11|20|60)/)){ $TRAN_CODE = "RCV"; } if (($TRANCODE0 =~m/(TSP|KSP)/) && ($QSIGN eq "-") && ($KEYCODE =~m/(1 +0|11|20|60)/)){ $TRAN_CODE = "DLV"; } if (($TRANCODE0 =~m/(TSP|KSP)/) && ($QUANTITY eq '00000000.00000') && + ($KEYCODE =~m/(10|11|20|60)/)){ $TRAN_CODE = "DLV"; } if (($TRANCODE0 eq "EXP") && ($SECTYPE eq "8")){ $TRAN_CODE = "OPTEXP"; } if (($TRANCODE0 eq "EXP") && ($SECTYPE ne '8')){ $TRAN_CODE = "DLV"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using a config file
by mzedeler (Pilgrim) on Jul 30, 2009 at 14:34 UTC | |
by mmittiga17 (Scribe) on Jul 30, 2009 at 14:55 UTC |