In a file named "shared-hash.dat":
Now all you need to do in each program to get the data:my %hash = ( '000001' => 'ITEM _First', '000002' => 'Item B', '000003' => 'House', '000004' => 'Service C', '000005' => 'Service X', '000006' => 'Service Z', '00007b' => 'Adjust Area', '020902' => 'Campus', '0sdc45' => 'Unit C', '000011' => 'Unit B', '0wed45' => 'Lower Level', '0ws456' => 'Cars', '02100m' => 'Numbers' );
All changes to the structure are made in one place: shared-hash.dat, in plain Perl syntax. For more info, see `perldoc -f do`. Of course, you're executing arbitrary Perl code, so make sure not just anyone can write to that datafile.my %hash = do "shared-hash.dat";
If you need the programs to write back to the hash (and have those changes shared), you will have to do something a little more involved, but it didn't sound like that was the case from your description.
blokhead
In reply to Re: Hash Question
by blokhead
in thread Hash Question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |