in reply to Re: Re: 4-way interchange mapping
in thread 4-way interchange mapping
You can see that the hashes are named "category type"_cat to save us issues with assigning each by hand (the eval statement takes care of that cleanly). Building this allows you to look parts up by any category, and then you can reference through the hash to the other four parts.use strict; my $WAI_cat; my $lester_cat; my $pic_cat; my $manu_cat; my $part_entry = { "lester" => "12345", "WAI" => "2-2342-01DU", "pic" => "340-87", "manu" => "72 4223" }; foreach(keys %$part_entry) { my $str= "\$\$".$_."_cat{'$$part_entry{$_}'} = \$part_entry"; #print $str.="\n"; eval($str); } print $$WAI_cat{"2-2342-01DU"}{lester}."\n"; print $$pic_cat{"340-87"}{manu}."\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: 4-way interchange mapping
by dsheroh (Monsignor) on May 10, 2002 at 00:24 UTC |