J
jm
Looking for guidance.
I have multiple arrays with data, and each element is directly associated
with the
same element number in the other arrays. I want to be able to access the
information
for each company by the account number in @acctnum.
Looks like I should be able to use hash of hash, which I don't quite
understand.
I Looked at perldsc and it doesn't make sense to me how to accomplish this.
Tried various ways of using my %HOH and always get errors.
If this can be done, please point me in the right direction, or explain.
use strict;
use warnings;
my @acctnums = ("000101", "000102", "000103", "000104", "000105");
my @companies = ("Flower Mart", "Amigos", "Lacy's", "Good Dairy", "Western
Wear");
my @addresses = ("1100 Fashion Drive", "544 Grand Ave.", "636 Miller Ave.",
"1536 Ocean View", "111 Camino Dr.");
my @cities = ("San Francisco", "San Mateo", "Belmont", "San Francisco",
"Burlingame");
my @phonenums = ("415-555-1234", "650-555-1234", "650-555-4567",
"415-555-9876", "650-555-5432");
my %acctnum = @acctnums;
my %company = @companies;
my %address = @addresses;
my %city = @cities;
my %phonenum = @phonenums;
my %HoH = (
acctnum => {company => address},
{address => city},
{city => phonenum}
);
thanks in advance
jm
I have multiple arrays with data, and each element is directly associated
with the
same element number in the other arrays. I want to be able to access the
information
for each company by the account number in @acctnum.
Looks like I should be able to use hash of hash, which I don't quite
understand.
I Looked at perldsc and it doesn't make sense to me how to accomplish this.
Tried various ways of using my %HOH and always get errors.
If this can be done, please point me in the right direction, or explain.
use strict;
use warnings;
my @acctnums = ("000101", "000102", "000103", "000104", "000105");
my @companies = ("Flower Mart", "Amigos", "Lacy's", "Good Dairy", "Western
Wear");
my @addresses = ("1100 Fashion Drive", "544 Grand Ave.", "636 Miller Ave.",
"1536 Ocean View", "111 Camino Dr.");
my @cities = ("San Francisco", "San Mateo", "Belmont", "San Francisco",
"Burlingame");
my @phonenums = ("415-555-1234", "650-555-1234", "650-555-4567",
"415-555-9876", "650-555-5432");
my %acctnum = @acctnums;
my %company = @companies;
my %address = @addresses;
my %city = @cities;
my %phonenum = @phonenums;
my %HoH = (
acctnum => {company => address},
{address => city},
{city => phonenum}
);
thanks in advance
jm