Se we have a bunch of vendor keys:
AAAB=Nike Inc
AAAC=Fish Co
etc...
I dumped these into a text file & am producing some reports wanting to convert from AAAB to Nike Inc
Since I am running this on thousands of objects DB lookups was not a great idea.
Here is what I came up with, looking for comments:
open(IN, "<type_conversion.txt") || die " 'type_conversion.txt' ($!)";
my
@lines = <IN> ;
my %hash ;
foreach $line (
@lines) {
chomp($line);
($key, $value) = split(/=/,$line) ;
$hash{$key} = $value;
}
$company = $hash("AAAB");
Any better way of doing this ? I have 400 lines in the list.
Comments ?